home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / dev / gui / gtlayout.lha / Source / LT_New.c < prev    next >
C/C++ Source or Header  |  1999-01-03  |  103KB  |  3,934 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1999 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. /*****************************************************************************/
  15.  
  16. #include <clib/alib_protos.h>    /* For NewList */
  17.  
  18. #include <stdarg.h>
  19.  
  20. /*****************************************************************************/
  21.  
  22. #include "Assert.h"
  23.  
  24. /*****************************************************************************/
  25.  
  26.  
  27. VOID
  28. LTP_ReplaceLabelShortcut(LayoutHandle *Handle,ObjectNode * Node)
  29. {
  30.     ULONG    Len;
  31.     STRPTR    Label,*Index = Node->Special.Button.Lines;
  32.     BOOL    GotIt = FALSE;
  33.  
  34.     while(!GotIt)
  35.     {
  36.         if(Index)
  37.         {
  38.             if(!(Label = *Index++))
  39.                 break;
  40.         }
  41.         else
  42.         {
  43.             Label = Node->Label;
  44.             GotIt = TRUE;
  45.         }
  46.  
  47.         Len = 0;
  48.  
  49.         while(Label[Len])
  50.         {
  51.             if(Label[Len] == '_' && Label[Len + 1])
  52.             {
  53.                 STRPTR NewLabel = LTP_Alloc(Handle,strlen(Label));
  54.  
  55.                 if(NewLabel)
  56.                 {
  57.                     if(Len)
  58.                         CopyMem(Label,NewLabel,Len);
  59.  
  60.                     strcpy(&NewLabel[Len],&Label[Len + 1]);
  61.  
  62.                     Node->Special.Button.KeyStroke = &NewLabel[Len];
  63.  
  64.                     Node->Key = ToLower(NewLabel[Len]);
  65.  
  66.                     if(Index)
  67.                         Index[-1] = NewLabel;
  68.                     else
  69.                         Node->Label = NewLabel;
  70.                 }
  71.  
  72.                 GotIt = TRUE;
  73.  
  74.                 break;
  75.             }
  76.  
  77.             Len++;
  78.         }
  79.     }
  80. }
  81.  
  82.  
  83. /*****************************************************************************/
  84.  
  85.  
  86. VOID
  87. LT_AddL(LayoutHandle *handle,LONG type,ULONG labelID,LONG id,...)    /* link library only */
  88. {
  89.     if(handle)
  90.     {
  91.         struct TagItem *tagList;
  92.         va_list varArg;
  93.  
  94.         va_start(varArg,id);
  95.  
  96.         tagList = (struct TagItem *)varArg;
  97.  
  98.         if(handle->LocaleHook)
  99.         {
  100.             STRPTR label;
  101.  
  102.             label = (STRPTR)CallHookPkt(handle->LocaleHook,handle,(APTR)labelID);
  103.  
  104.             LT_AddA(handle,type,label,id,tagList);
  105.         }
  106.         else
  107.             handle->Failed = TRUE;
  108.  
  109.         va_end(varArgs);
  110.     }
  111. }
  112.  
  113.  
  114. /*****************************************************************************/
  115.  
  116.  
  117. VOID
  118. LT_New(LayoutHandle *handle,...)    /* link library only */
  119. {
  120.     va_list VarArgs;
  121.  
  122.     va_start(VarArgs,handle);
  123.     LT_NewA(handle,(struct TagItem *)VarArgs);
  124.     va_end(VarArgs);
  125. }
  126.  
  127.  
  128. /*****************************************************************************/
  129.  
  130.  
  131. VOID
  132. LT_Add(
  133.     LayoutHandle *    Handle,
  134.     LONG            Type,
  135.     STRPTR            Label,
  136.     LONG            ID,
  137.                     ...)    /* link library only */
  138. {
  139.     va_list VarArgs;
  140.  
  141.     va_start(VarArgs,ID);
  142.     LT_AddA(Handle,Type,Label,ID,(struct TagItem *)VarArgs);
  143.     va_end(VarArgs);
  144. }
  145.  
  146.  
  147. /*****************************************************************************/
  148.  
  149.  
  150. VOID LIBENT
  151. LT_AddA(
  152.     REG(a0) LayoutHandle *        Handle,
  153.     REG(d0) LONG                Type,
  154.     REG(d1) STRPTR                Label,
  155.     REG(d2) LONG                ID,
  156.     REG(a1) struct TagItem *    TagList)
  157. {
  158.     struct TagItem *TagItem;
  159.  
  160.     if(!Handle || Handle->Failed)
  161.         return;
  162.  
  163.     if(Type < GENERIC_KIND)
  164.     {
  165.         Handle->Failed = TRUE;
  166.         return;
  167.     }
  168.  
  169.     if(Type == VERTICAL_KIND || Type == HORIZONTAL_KIND || Handle->TopGroup)
  170.     {
  171.         ObjectNode *Node;
  172.         ULONG IDCMP;
  173.  
  174.         IDCMP = NULL;
  175.  
  176.         switch(Type)
  177.         {
  178.             case BUTTON_KIND:
  179.  
  180.                 IDCMP = BUTTONIDCMP;
  181.                 break;
  182.  
  183.             case CHECKBOX_KIND:
  184.  
  185.                 IDCMP = CHECKBOXIDCMP | IDCMP_MOUSEBUTTONS;
  186.                 break;
  187.  
  188.             case LISTVIEW_KIND:
  189.  
  190.                 IDCMP = LISTVIEWIDCMP;
  191.                 break;
  192.  
  193.             case MX_KIND:
  194.  
  195.                 IDCMP = MXIDCMP | IDCMP_MOUSEBUTTONS;
  196.                 break;
  197.  
  198.             case CYCLE_KIND:
  199.  
  200.                 IDCMP = CYCLEIDCMP;
  201.                 break;
  202.  
  203.             case PALETTE_KIND:
  204.  
  205.                 IDCMP = PALETTEIDCMP;
  206.                 break;
  207.  
  208.             case SLIDER_KIND:
  209.  
  210.                 IDCMP = SLIDERIDCMP;
  211.                 break;
  212.  
  213.             case SCROLLER_KIND:
  214.  
  215.                 IDCMP = SCROLLERIDCMP | ARROWIDCMP;
  216.                 break;
  217.  
  218.             case INTEGER_KIND:
  219.  
  220.                 IDCMP = STRINGIDCMP | IDCMP_GADGETDOWN | IDCMP_INTUITICKS;
  221.                 break;
  222.  
  223.             case FRAME_KIND:
  224.  
  225.                 IDCMP = IDCMP_MOUSEBUTTONS;
  226.                 break;
  227.  
  228.             case FRACTION_KIND:
  229.             case STRING_KIND:
  230.             case PASSWORD_KIND:
  231.  
  232.                 IDCMP = STRINGIDCMP | IDCMP_GADGETDOWN;
  233.                 break;
  234.  
  235.             #ifdef DO_LEVEL_KIND
  236.             {
  237.                 case LEVEL_KIND:
  238.  
  239.                     IDCMP = IDCMP_GADGETDOWN | IDCMP_MOUSEMOVE | IDCMP_GADGETUP;
  240.                     break;
  241.             }
  242.             #endif    /* DO_LEVEL_KIND */
  243.  
  244.             case END_KIND:
  245.  
  246.                 /* new in 45.1: fail if there is no group to be closed */
  247.                 if(Handle->CurrentGroup == NULL)
  248.                 {
  249.                     Handle->Failed = TRUE;
  250.                 }
  251.                 else
  252.                 {
  253.                     Handle->CurrentGroup = Handle->CurrentGroup->Special.Group.ParentGroup;
  254.                 }
  255.  
  256.                 return;
  257.  
  258.             #ifdef DO_POPUP_KIND
  259.             {
  260.                 case POPUP_KIND:
  261.  
  262.                     IDCMP = IDCMP_GADGETUP;
  263.                     break;
  264.             }
  265.             #endif
  266.  
  267.             #ifdef DO_TAB_KIND
  268.             {
  269.                 case TAB_KIND:
  270.  
  271.                     IDCMP = IDCMP_GADGETUP;
  272.                     break;
  273.             }
  274.             #endif
  275.  
  276.             #ifdef DO_TEXTEDIT_KIND
  277.             {
  278.                 case TEXTEDIT_KIND:
  279.  
  280.                     IDCMP = IDCMP_GADGETUP | IDCMP_GADGETDOWN;
  281.                     break;
  282.             }
  283.             #endif /* DO_TEXTEDIT_KIND */
  284.         }
  285.  
  286.         Handle->IDCMP |= IDCMP;
  287.  
  288.         if(Node = LTP_CreateObjectNode(Handle,Type,ID,Label))
  289.         {
  290.             struct MinList *ParentList;
  291.             LONG FirstLabel;
  292.             LONG LastLabel;
  293.             LONG *LabelTable;
  294.             LONG *LineTable;
  295.             LONG FirstLine;
  296.             LONG LastLine;
  297.             STRPTR BoxLine;
  298.  
  299.             BoxLine = NULL;
  300.             LabelTable = LineTable = NULL;
  301.             FirstLabel = LastLabel = FirstLine = LastLine = -1;
  302.             Type = Node->Type;
  303.  
  304.             if(Type == GROUP_KIND)
  305.             {
  306.                 Node->Special.Group.ParentGroup = Handle->CurrentGroup;
  307.  
  308.                 if(!ID)
  309.                     Node->ID = Handle->GroupID--;
  310.  
  311.                 if(!Handle->TopGroup)
  312.                 {
  313.                     Handle->TopGroup = Node;
  314.  
  315.                     ParentList = NULL;
  316.                 }
  317.                 else
  318.                     ParentList = &Handle->CurrentGroup->Special.Group.ObjectList;
  319.  
  320.                 Handle->CurrentGroup = Node;
  321.  
  322.                 NewList((struct List *)&Node->Special.Group.ObjectList);
  323.             }
  324.             else
  325.                 ParentList = &Handle->CurrentGroup->Special.Group.ObjectList;
  326.  
  327.             if(Label && !Node->NoKey)
  328.             {
  329.                 LONG Len;
  330.  
  331.                 for(Len = 0 ; Label[Len] ; Len++)
  332.                 {
  333.                     if(Label[Len] == '_')
  334.                     {
  335.                         Node->Key = ToLower(Label[Len + 1]);
  336.  
  337.                         break;
  338.                     }
  339.                 }
  340.             }
  341.  
  342.             if(TagList)
  343.             {
  344.                 struct TagItem *TempList = TagList;
  345.                 ULONG ti_Data;
  346.  
  347.                 while(TagItem = NextTagItem(&TempList))
  348.                 {
  349.                     ti_Data = TagItem->ti_Data;
  350.  
  351.                     switch(TagItem->ti_Tag)
  352.                     {
  353.                         case LA_BYTE:
  354.  
  355.                             Node->Storage         = (APTR)ti_Data;
  356.                             Node->StorageType    = STORAGE_BYTE;
  357.  
  358.                             LTP_GetStorage(Node);
  359.  
  360.                             break;
  361.  
  362.                         case LA_UBYTE:
  363.  
  364.                             Node->Storage         = (APTR)ti_Data;
  365.                             Node->StorageType    = STORAGE_UBYTE;
  366.  
  367.                             LTP_GetStorage(Node);
  368.  
  369.                             break;
  370.  
  371.                         case LA_WORD:
  372.  
  373.                             Node->Storage         = (APTR)ti_Data;
  374.                             Node->StorageType    = STORAGE_WORD;
  375.  
  376.                             LTP_GetStorage(Node);
  377.  
  378.                             break;
  379.  
  380.                         case LA_UWORD:
  381.  
  382.                             Node->Storage         = (APTR)ti_Data;
  383.                             Node->StorageType    = STORAGE_UWORD;
  384.  
  385.                             LTP_GetStorage(Node);
  386.  
  387.                             break;
  388.  
  389.                         case LA_LONG:
  390.  
  391.                             Node->Storage         = (APTR)ti_Data;
  392.                             Node->StorageType    = STORAGE_LONG;
  393.  
  394.                             LTP_GetStorage(Node);
  395.  
  396.                             break;
  397.  
  398.                         case LA_ULONG:
  399.  
  400.                             Node->Storage         = (APTR)ti_Data;
  401.                             Node->StorageType    = STORAGE_ULONG;
  402.  
  403.                             LTP_GetStorage(Node);
  404.  
  405.                             break;
  406.  
  407.                         case LA_STRPTR:
  408.  
  409.                             Node->Storage         = (APTR)ti_Data;
  410.                             Node->StorageType    = STORAGE_STRPTR;
  411.  
  412.                             LTP_GetStorage(Node);
  413.  
  414.                             break;
  415.  
  416.                         case LAXB_FullSize:
  417.  
  418.                             if(Type == XBAR_KIND || Type == YBAR_KIND)
  419.                                 Node->Special.Bar.FullSize = ti_Data;
  420.  
  421.                             break;
  422.  
  423.                         case LA_LabelTable:
  424.  
  425.                             LabelTable = (LONG *)ti_Data;
  426.                             break;
  427.  
  428.                         case LA_FirstLabel:
  429.  
  430.                             FirstLabel = ti_Data;
  431.                             break;
  432.  
  433.                         case LA_LastLabel:
  434.  
  435.                             LastLabel = ti_Data;
  436.                             break;
  437.  
  438.                         case LA_LastGadget:
  439.  
  440.                             if(Type == INTEGER_KIND)
  441.                                 Node->Special.Integer.LastGadget = ti_Data;
  442.  
  443.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  444.                                 Node->Special.String.LastGadget = ti_Data;
  445.  
  446.                             #ifdef DO_TEXTEDIT_KIND
  447.                             {
  448.                                 if(Type == TEXTEDIT_KIND)
  449.                                     Node->Special.TextEdit.LastGadget = ti_Data;
  450.                             }
  451.                             #endif /* DO_TEXTEDIT_KIND */
  452.  
  453.                             break;
  454.  
  455.                         case LA_LabelChars:
  456.  
  457.                             Node->LabelChars = ti_Data;
  458.  
  459.                             break;
  460.  
  461.                         case LA_HistoryLines:
  462.  
  463.                             if(Type == INTEGER_KIND)
  464.                                 Node->Special.Integer.MaxHistoryLines = ti_Data;
  465.  
  466.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  467.                                 Node->Special.String.MaxHistoryLines = ti_Data;
  468.  
  469.                             break;
  470.  
  471.                         case LA_HistoryHook:
  472.  
  473.                             if(Type == INTEGER_KIND)
  474.                                 Node->Special.Integer.HistoryHook = (struct Hook *)ti_Data;
  475.  
  476.                             if(Type == STRING_KIND || Type == FRACTION_KIND)
  477.                                 Node->Special.String.HistoryHook = (struct Hook *)ti_Data;
  478.  
  479.                             break;
  480.  
  481.                         case LAIN_IncrementerHook:
  482.  
  483.                             if(Type == INTEGER_KIND)
  484.                                 Node->Special.Integer.IncrementerHook = (struct Hook *)ti_Data;
  485.  
  486.                             if(Type == FRACTION_KIND)
  487.                             {
  488.                                 if(Node->Special.String.IncrementerHook = (struct Hook *)ti_Data)
  489.                                     Handle->IDCMP |= IDCMP_INTUITICKS;
  490.                             }
  491.  
  492.                             break;
  493.  
  494.                         case LA_Min:
  495.  
  496.                             Node->Min = ti_Data;
  497.  
  498.                             break;
  499.  
  500.                         case LA_Max:
  501.  
  502.                             Node->Max = ti_Data;
  503.  
  504.                             break;
  505.  
  506.                         case LABX_Spacing:
  507.  
  508.                             if(Type == BOX_KIND)
  509.                                 Node->Special.Box.Spacing = ti_Data;
  510.  
  511.                             break;
  512.  
  513.                         case LABX_ReserveSpace:
  514.  
  515.                             if(Type == BOX_KIND)
  516.                                 Node->Special.Box.ReserveSpace = ti_Data;
  517.  
  518.                             break;
  519.  
  520.                         case LABX_TextPen:
  521.  
  522.                             if(Type == BOX_KIND)
  523.                                 Node->Special.Box.TextPen = ti_Data;
  524.  
  525.                             break;
  526.  
  527.                         case LABX_BackPen:
  528.  
  529.                             if(Type == BOX_KIND)
  530.                                 Node->Special.Box.BackPen = ti_Data;
  531.  
  532.                             break;
  533.  
  534.                         case LA_Chars:
  535.  
  536.                             Node->Chars = ti_Data;
  537.  
  538.                             break;
  539.  
  540.                         case LA_LabelPlace:
  541.  
  542.                             /* The group label placement cannot be
  543.                              * changed, and never could (new in V45.1).
  544.                              */
  545.                             if(Type != GROUP_KIND)
  546.                             {
  547.                                 Node->LabelPlace = ti_Data;
  548.         
  549.                                 if(Type == MX_KIND)
  550.                                 {
  551.                                     if(ti_Data == PLACE_RIGHT)
  552.                                         Node->LabelPlace = PLACE_RIGHT;
  553.                                     else
  554.                                         Node->LabelPlace = PLACE_LEFT;
  555.                                 }
  556.                             }
  557.  
  558.                             break;
  559.  
  560.                         case LA_ExtraSpace:
  561.  
  562.                             Node->ExtraSpace = (WORD)ti_Data;
  563.  
  564.                             if(Node->ExtraSpace == 1)
  565.                                 Node->ExtraSpace = 3;
  566.  
  567.                             break;
  568.  
  569.                         case LA_LayoutSpace:
  570.  
  571.                             Node->LayoutSpace = (UWORD)ti_Data;
  572.                             break;
  573.  
  574.                         case LA_PageSelector:
  575.  
  576.                             Node->PageSelector = ti_Data;
  577.                             break;
  578.  
  579.                         case LABT_ExtraFat:
  580.  
  581.                             if(Node->Type == BUTTON_KIND)
  582.                                 Node->Special.Button.ExtraFat = ti_Data;
  583.  
  584.                             break;
  585.  
  586.                         case LABT_Smaller:
  587.  
  588.                             if(Node->Type == BUTTON_KIND)
  589.                                 Node->Special.Button.Smaller = ti_Data;
  590.  
  591.                             break;
  592.  
  593.                         case LABT_DefaultCorrection:
  594.  
  595.                             if(Node->Type == BUTTON_KIND)
  596.                                 Node->Special.Button.DefaultCorrection = ti_Data;
  597.  
  598.                             break;
  599.  
  600.                         case LABT_Lines:
  601.  
  602.                             if(Node->Type == BUTTON_KIND)
  603.                                 Node->Special.Button.Lines = (STRPTR *)ti_Data;
  604.  
  605.                             break;
  606.  
  607.                         #ifdef DO_PICKSHORTCUTS
  608.                         {
  609.                             case LA_NoKey:
  610.  
  611.                                 Node->NoKey = ti_Data;
  612.                                 break;
  613.                         }
  614.                         #endif
  615.  
  616.                         case LA_DefaultSize:
  617.  
  618.                             Node->DefaultSize = ti_Data;
  619.                             break;
  620.  
  621.                         case LA_HighLabel:
  622.  
  623.                             Node->HighLabel = ti_Data;
  624.                             break;
  625.  
  626.                         case LAPA_SmallPalette:
  627.  
  628.                             if(Type == PALETTE_KIND)
  629.                                 Node->Special.Palette.SmallPalette = ti_Data;
  630.  
  631.                             break;
  632.  
  633.                         case LAPA_UsePicker:
  634.  
  635.                             if(Type == PALETTE_KIND)
  636.                                 Node->Special.Palette.UsePicker = ti_Data;
  637.  
  638.                             break;
  639.  
  640.                         case LA_Lines:
  641.  
  642.                             if(Type == BOX_KIND)
  643.                             {
  644.                                 LONG Count = ti_Data;
  645.  
  646.                                 if(Node->Lines != Count)
  647.                                 {
  648.                                     LTP_Free(Handle,Node->Special.Box.Lines,sizeof(STRPTR) * Node->Lines);
  649.  
  650.                                     Node->Special.Box.Lines = NULL;
  651.                                 }
  652.  
  653.                                 if(!Node->Special.Box.Lines)
  654.                                 {
  655.                                     if(Node->Special.Box.Lines = (STRPTR *)LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  656.                                     {
  657.                                         LONG i;
  658.  
  659.                                         for(i = 0 ; i < Count ; i++)
  660.                                             Node->Special.Box.Lines[i] = "";
  661.                                     }
  662.                                 }
  663.                             }
  664.  
  665.                             Node->Lines = ti_Data;
  666.  
  667.                             break;
  668.  
  669.                         case LA_Picker:
  670.  
  671.                             if(Type == TEXT_KIND)
  672.                                 Node->Special.Text.UsePicker = ti_Data;
  673.  
  674.                             if(Type == STRING_KIND)
  675.                                 Node->Special.String.UsePicker = ti_Data;
  676.  
  677.                             break;
  678.  
  679.                         case LACY_AutoPageID:
  680.  
  681.                             if(Type == CYCLE_KIND)
  682.                                 Node->Special.Cycle.AutoPageID = (LONG)ti_Data;
  683.  
  684.                             #ifdef DO_POPUP_KIND
  685.                             {
  686.                                 if(Type == POPUP_KIND)
  687.                                     Node->Special.Popup.AutoPageID = (LONG)ti_Data;
  688.                             }
  689.                             #endif
  690.  
  691.                             #ifdef DO_TAB_KIND
  692.                             {
  693.                                 if(Type == TAB_KIND)
  694.                                     Node->Special.Tab.AutoPageID = (LONG)ti_Data;
  695.                             }
  696.                             #endif
  697.  
  698.                             if(Type == MX_KIND)
  699.                                 Node->Special.Radio.AutoPageID = (LONG)ti_Data;
  700.  
  701.                             if(Type == LISTVIEW_KIND)
  702.                                 Node->Special.List.AutoPageID = (LONG)ti_Data;
  703.  
  704.                             break;
  705.  
  706.                         case LAGR_Spread:
  707.  
  708.                             if(Type == GROUP_KIND)
  709.                                 Node->Special.Group.Spread = ti_Data;
  710.  
  711.                             break;
  712.  
  713.                         case LAGR_AlignRight:
  714.  
  715.                             if(Type == GROUP_KIND)
  716.                                 Node->Special.Group.AlignRight = ti_Data;
  717.  
  718.                             break;
  719.  
  720.                         case LAGR_FrameGroup:
  721.  
  722.                             if(Type == GROUP_KIND)
  723.                                 Node->Special.Group.FrameType = ti_Data;
  724.  
  725.                             break;
  726.  
  727.                         case LAGR_NoIndent:
  728.  
  729.                             if(Type == GROUP_KIND)
  730.                                 Node->Special.Group.NoIndent = ti_Data;
  731.  
  732.                             break;
  733.  
  734.                         case LAGR_IndentX:
  735.  
  736.                             if(Type == GROUP_KIND)
  737.                                 Node->Special.Group.IndentX = ti_Data;
  738.  
  739.                             break;
  740.  
  741.                         case LAGR_IndentY:
  742.  
  743.                             if(Type == GROUP_KIND)
  744.                                 Node->Special.Group.IndentY = ti_Data;
  745.  
  746.                             break;
  747.  
  748.                         case LAGR_Frame:
  749.  
  750.                             if(Type == GROUP_KIND)
  751.                                 Node->Special.Group.Frame = ti_Data;
  752.  
  753.                             break;
  754.  
  755.                         case LAGR_SameSize:
  756.  
  757.                             if(Type == GROUP_KIND)
  758.                                 Node->Special.Group.SameSize = ti_Data;
  759.  
  760.                             break;
  761.  
  762.                         case LAGR_LastAttributes:
  763.  
  764.                             if(Type == GROUP_KIND)
  765.                                 Node->Special.Group.LastAttributes = ti_Data;
  766.  
  767.                             break;
  768.  
  769.                         case LAGR_ActivePage:
  770.  
  771.                             if(Type == GROUP_KIND)
  772.                             {
  773.                                 Node->Special.Group.ActivePage    = ti_Data;
  774.                                 Node->Special.Group.Paging    = TRUE;
  775.                             }
  776.  
  777.                             break;
  778.  
  779.                         case LABT_ReturnKey:
  780.  
  781.                             if(Type == BUTTON_KIND)
  782.                                 Node->Special.Button.ReturnKey = ti_Data;
  783.  
  784.                             break;
  785.  
  786.                         case LABT_EscKey:
  787.  
  788.                             if(Type == BUTTON_KIND)
  789.                                 Node->Special.Button.EscKey = ti_Data;
  790.  
  791.                             break;
  792.  
  793.                         case LALV_AdjustForString:
  794.  
  795.                             if(Type == LISTVIEW_KIND)
  796.                                 Node->Special.List.AdjustForString = ti_Data;
  797.  
  798.                             break;
  799.  
  800.                         case LALV_CursorKey:
  801.  
  802.                             if(Type == LISTVIEW_KIND)
  803.                                 Node->Special.List.CursorKey = ti_Data;
  804.  
  805.                             break;
  806.  
  807.                         case LALV_TextAttr:
  808.  
  809.                             if(Type == LISTVIEW_KIND)
  810.                                 Node->Special.List.TextAttr = (struct TextAttr *)ti_Data;
  811.  
  812.                             #ifdef DO_TEXTEDIT_KIND
  813.                             {
  814.                                 if(Type == TEXTEDIT_KIND)
  815.                                     Node->Special.TextEdit.TextAttr = (struct TextAttr *)ti_Data;
  816.                             }
  817.                             #endif /* DO_TEXTEDIT_KIND */
  818.  
  819.                             break;
  820.  
  821.                         case LALV_LockSize:
  822.  
  823.                             if(Type == LISTVIEW_KIND)
  824.                                 Node->Special.List.LockSize = ti_Data;
  825.  
  826.                             if(Type == TEXT_KIND)
  827.                                 Node->Special.Text.LockSize = ti_Data;
  828.  
  829.                             break;
  830.  
  831.                         case LALV_MaxGrowX:
  832.  
  833.                             if(Type == LISTVIEW_KIND)
  834.                             {
  835.                                 Handle->GrowView = Node;
  836.  
  837.                                 Node->Special.List.MaxGrowX = ti_Data;
  838.                             }
  839.  
  840.                             break;
  841.  
  842.                         case LALV_MaxGrowY:
  843.  
  844.                             if(Type == LISTVIEW_KIND)
  845.                             {
  846.                                 Handle->GrowView = Node;
  847.  
  848.                                 Node->Special.List.MaxGrowY = ti_Data;
  849.                             }
  850.  
  851.                             break;
  852.  
  853.                         case LALV_ResizeX:
  854.  
  855.                             if(Type == LISTVIEW_KIND)
  856.                             {
  857.                                 Handle->ResizeObject = Node;
  858.  
  859.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  860.  
  861.                                 Node->Special.List.ResizeX = ti_Data;
  862.                             }
  863.  
  864.                             if(Type == FRAME_KIND)
  865.                             {
  866.                                 Handle->ResizeObject = Node;
  867.  
  868.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  869.  
  870.                                 Node->Special.Frame.ResizeX = ti_Data;
  871.                             }
  872.  
  873.                             break;
  874.  
  875.                         case LALV_ResizeY:
  876.  
  877.                             if(Type == LISTVIEW_KIND)
  878.                             {
  879.                                 Handle->ResizeObject = Node;
  880.  
  881.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  882.  
  883.                                 Node->Special.List.ResizeY = ti_Data;
  884.                             }
  885.  
  886.                             if(Type == FRAME_KIND)
  887.                             {
  888.                                 Handle->ResizeObject = Node;
  889.  
  890.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  891.  
  892.                                 Node->Special.Frame.ResizeY = ti_Data;
  893.                             }
  894.  
  895.                             break;
  896.  
  897.                         case LALV_MinChars:
  898.  
  899.                             if(Type == LISTVIEW_KIND)
  900.                                 Node->Special.List.MinChars = ti_Data;
  901.  
  902.                             break;
  903.  
  904.                         case LALV_MinLines:
  905.  
  906.                             if(Type == LISTVIEW_KIND)
  907.                                 Node->Special.List.MinLines = ti_Data;
  908.  
  909.                             break;
  910.  
  911.                         case LALV_FlushLabelLeft:
  912.  
  913.                             if(Type == LISTVIEW_KIND)
  914.                                 Node->Special.List.FlushLabelLeft = ti_Data;
  915.  
  916.                             break;
  917.  
  918.                         case LALV_Labels:
  919.  
  920.                             if(Type == LISTVIEW_KIND)
  921.                             {
  922.                                 STRPTR *Labels = (STRPTR *)ti_Data;
  923.  
  924.                                 if(*Labels)
  925.                                 {
  926.                                     struct List *SomeList;
  927.  
  928.                                     if(SomeList = LTP_Alloc(Handle,sizeof(struct List)))
  929.                                     {
  930.                                         struct Node *SomeNode;
  931.  
  932.                                         NewList(SomeList);
  933.  
  934.                                         Node->Special.List.Labels = SomeList;
  935.  
  936.                                         while(*Labels)
  937.                                         {
  938.                                             if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node) + strlen(*Labels) + 1))
  939.                                             {
  940.                                                 SomeNode->ln_Name = (STRPTR)(SomeNode + 1);
  941.  
  942.                                                 strcpy(SomeNode->ln_Name,*Labels++);
  943.  
  944.                                                 AddTail(SomeList,SomeNode);
  945.                                             }
  946.                                         }
  947.                                     }
  948.                                 }
  949.                             }
  950.  
  951.                             break;
  952.  
  953.                         case LA_Link:
  954.  
  955.                             if(Type == LISTVIEW_KIND)
  956.                                 Node->Special.List.LinkID = ti_Data;
  957.  
  958.                             if(Type == STRING_KIND)
  959.                                 Node->Special.String.LinkID = ti_Data;
  960.  
  961.                             if(Type == BOOPSI_KIND)
  962.                                 Node->Special.BOOPSI.Link = (LONG)ti_Data;
  963.  
  964.                             break;
  965.  
  966.                         #ifdef DO_TAPEDECK_KIND
  967.                         {
  968.                             case LATD_ButtonType:
  969.  
  970.                                 if(Type == TAPEDECK_KIND)
  971.                                     Node->Special.TapeDeck.ButtonType = ti_Data;
  972.  
  973.                                 break;
  974.  
  975.                             case LATD_Toggle:
  976.  
  977.                                 if(Type == TAPEDECK_KIND)
  978.                                     Node->Special.TapeDeck.Toggle = ti_Data;
  979.  
  980.                                 break;
  981.  
  982.                             case LATD_Pressed:
  983.  
  984.                                 if(Type == TAPEDECK_KIND)
  985.                                     Node->Current = ti_Data;
  986.  
  987.                                 break;
  988.  
  989.                             case LATD_Tick:
  990.  
  991.                                 if(Type == TAPEDECK_KIND)
  992.                                     Node->Special.TapeDeck.Tick = ti_Data;
  993.  
  994.                                 break;
  995.  
  996.                             case LATD_Smaller:
  997.  
  998.                                 if(Type == TAPEDECK_KIND)
  999.                                     Node->Special.TapeDeck.Smaller = ti_Data;
  1000.  
  1001.                                 break;
  1002.                         }
  1003.                         #endif    /* DO_TAPEDECK_KIND */
  1004.  
  1005.                         #ifdef DO_GAUGE_KIND
  1006.                         {
  1007.                             case LAGA_Percent:
  1008.  
  1009.                                 if(Type == GAUGE_KIND)
  1010.                                 {
  1011.                                     LONG Percent = (LONG)ti_Data;
  1012.  
  1013.                                     if(Percent <= 0)
  1014.                                         Node->Current = 0;
  1015.                                     else
  1016.                                     {
  1017.                                         if(Percent > 100)
  1018.                                             Node->Current = 100;
  1019.                                         else
  1020.                                             Node->Current = Percent;
  1021.                                     }
  1022.                                 }
  1023.  
  1024.                                 break;
  1025.  
  1026.                             case LAGA_NoTicks:
  1027.  
  1028.                                 if(Type == GAUGE_KIND)
  1029.                                     Node->Special.Gauge.NoTicks = ti_Data;
  1030.  
  1031.                                 break;
  1032.  
  1033.                             case LAGA_Discrete:
  1034.  
  1035.                                 if(Type == GAUGE_KIND)
  1036.                                     Node->Special.Gauge.Discrete = ti_Data;
  1037.  
  1038.                                 break;
  1039.  
  1040.                             case LAGA_InfoLength:
  1041.  
  1042.                                 if(Type == GAUGE_KIND)
  1043.                                 {
  1044.                                     LONG Length = (LONG)ti_Data;
  1045.  
  1046.                                     if(Length > Node->Special.Gauge.InfoLength)
  1047.                                     {
  1048.                                         STRPTR NewText;
  1049.  
  1050.                                         if(NewText = (STRPTR)LTP_Alloc(Handle,Length + 1))
  1051.                                         {
  1052.                                             if(Node->Special.Gauge.InfoText)
  1053.                                             {
  1054.                                                 strcpy(NewText,Node->Special.Gauge.InfoText);
  1055.  
  1056.                                                 LTP_Free(Handle,Node->Special.Gauge.InfoText,Node->Special.Gauge.InfoLength + 1);
  1057.                                             }
  1058.  
  1059.                                             NewText[0] = 0;
  1060.  
  1061.                                             Node->Special.Gauge.InfoText    = NewText;
  1062.                                             Node->Special.Gauge.InfoLength    = Length;
  1063.                                         }
  1064.                                     }
  1065.                                 }
  1066.  
  1067.                                 break;
  1068.  
  1069.                             case LAGA_InfoText:
  1070.  
  1071.                                 if(Type == GAUGE_KIND)
  1072.                                 {
  1073.                                     STRPTR    SomeText    = (STRPTR)ti_Data;
  1074.                                     LONG    Len            = strlen(SomeText);
  1075.  
  1076.                                     if(!Node->Special.Gauge.InfoLength)
  1077.                                     {
  1078.                                         if(Node->Special.Gauge.InfoText = (STRPTR)LTP_Alloc(Handle,Len + 1))
  1079.                                             Node->Special.Gauge.InfoLength = Len;
  1080.                                     }
  1081.  
  1082.                                     if(Node->Special.Gauge.InfoLength)
  1083.                                     {
  1084.                                         if(Len > Node->Special.Gauge.InfoLength)
  1085.                                             Len = Node->Special.Gauge.InfoLength;
  1086.  
  1087.                                         CopyMem(SomeText,Node->Special.Gauge.InfoText,Len);
  1088.  
  1089.                                         Node->Special.Gauge.InfoText[Len] = 0;
  1090.                                     }
  1091.                                 }
  1092.  
  1093.                                 break;
  1094.                         }
  1095.                         #endif
  1096.  
  1097.                         case LALV_ExtraLabels:
  1098.  
  1099.                             if(Type == LISTVIEW_KIND)
  1100.                                 Node->Special.List.ExtraLabels = (STRPTR *)ti_Data;
  1101.  
  1102.                             break;
  1103.  
  1104.                         case LACY_TabKey:
  1105.  
  1106.                             if(Type == CYCLE_KIND)
  1107.                                 Node->Special.Cycle.TabKey = ti_Data;
  1108.  
  1109.                             #ifdef DO_POPUP_KIND
  1110.                             {
  1111.                                 if(Type == POPUP_KIND)
  1112.                                     Node->Special.Popup.TabKey = ti_Data;
  1113.                             }
  1114.                             #endif
  1115.  
  1116.                             #ifdef DO_TAB_KIND
  1117.                             {
  1118.                                 if(Type == TAB_KIND)
  1119.                                     Node->Special.Tab.TabKey = ti_Data;
  1120.                             }
  1121.                             #endif
  1122.  
  1123.                             if(Type == MX_KIND)
  1124.                                 Node->Special.Radio.TabKey = ti_Data;
  1125.  
  1126.                             break;
  1127.  
  1128.                         #ifdef DO_TAB_KIND
  1129.                         {
  1130.                             case LATB_FullWidth:
  1131.  
  1132.                                 if(Type == TAB_KIND)
  1133.                                     Node->Special.Tab.FullWidth = ti_Data;
  1134.  
  1135.                                 break;
  1136.                         }
  1137.                         #endif
  1138.  
  1139.                         #ifdef DO_BOOPSI_KIND
  1140.                         {
  1141.                             case LABO_FullWidth:
  1142.  
  1143.                                 if(Type == BOOPSI_KIND)
  1144.                                     Node->Special.BOOPSI.FullWidth = (WORD)ti_Data;
  1145.  
  1146.                                 break;
  1147.  
  1148.                             case LABO_ActivateHook:
  1149.  
  1150.                                 if(Type == BOOPSI_KIND)
  1151.                                     Node->Special.BOOPSI.ActivateHook = (struct Hook *)ti_Data;
  1152.  
  1153.                                 break;
  1154.  
  1155.                             case LABO_FullHeight:
  1156.  
  1157.                                 if(Type == BOOPSI_KIND)
  1158.                                     Node->Special.BOOPSI.FullHeight = (WORD)ti_Data;
  1159.  
  1160.                                 break;
  1161.  
  1162.                             case LABO_RelFontHeight:
  1163.  
  1164.                                 if(Type == BOOPSI_KIND)
  1165.                                     Node->Special.BOOPSI.RelFontHeight = (WORD)ti_Data;
  1166.  
  1167.                                 break;
  1168.  
  1169.                             case LABO_TagScreen:
  1170.  
  1171.                                 if(Type == BOOPSI_KIND)
  1172.                                     Node->Special.BOOPSI.TagScreen = ti_Data;
  1173.  
  1174.                                 break;
  1175.  
  1176.                             case LABO_TagCurrent:
  1177.  
  1178.                                 if(Type == BOOPSI_KIND)
  1179.                                     Node->Special.BOOPSI.TagCurrent = ti_Data;
  1180.  
  1181.                                 break;
  1182.  
  1183.                             case LABO_TagLink:
  1184.  
  1185.                                 if(Type == BOOPSI_KIND)
  1186.                                     Node->Special.BOOPSI.TagLink = ti_Data;
  1187.  
  1188.                                 break;
  1189.  
  1190.                             case LABO_ExactWidth:
  1191.  
  1192.                                 if(Type == BOOPSI_KIND)
  1193.                                     Node->Special.BOOPSI.ExactWidth = ti_Data;
  1194.  
  1195.                                 break;
  1196.  
  1197.                             case LABO_ExactHeight:
  1198.  
  1199.                                 if(Type == BOOPSI_KIND)
  1200.                                     Node->Special.BOOPSI.ExactHeight = ti_Data;
  1201.  
  1202.                                 break;
  1203.  
  1204.                             case LABO_TagTextAttr:
  1205.  
  1206.                                 if(Type == BOOPSI_KIND)
  1207.                                     Node->Special.BOOPSI.TagTextAttr = ti_Data;
  1208.  
  1209.                                 break;
  1210.  
  1211.                             case LABO_TagDrawInfo:
  1212.  
  1213.                                 if(Type == BOOPSI_KIND)
  1214.                                     Node->Special.BOOPSI.TagDrawInfo = ti_Data;
  1215.  
  1216.                                 break;
  1217.  
  1218.                             case LABO_ClassInstance:
  1219.  
  1220.                                 if(Type == BOOPSI_KIND)
  1221.                                     Node->Special.BOOPSI.ClassInstance = (Class *)ti_Data;
  1222.  
  1223.                                 break;
  1224.  
  1225.                             case LABO_ClassName:
  1226.  
  1227.                                 if(Type == BOOPSI_KIND)
  1228.                                     Node->Special.BOOPSI.ClassName = (STRPTR)ti_Data;
  1229.  
  1230.                                 break;
  1231.  
  1232.                             case LABO_ClassLibraryName:
  1233.  
  1234.                                 if(Type == BOOPSI_KIND)
  1235.                                     Node->Special.BOOPSI.ClassLibraryName = (STRPTR)ti_Data;
  1236.  
  1237.                                 break;
  1238.                         }
  1239.                         #endif    /* DO_BOOPSI_KIND */
  1240.  
  1241.                         case LAIM_Image:
  1242.  
  1243.                             if(Node->Type == IMAGE_KIND)
  1244.                                 Node->Special.Image.Image = (struct Image *)ti_Data;
  1245.  
  1246.                             break;
  1247.  
  1248.                         case LAIM_BitMap:
  1249.  
  1250.                             if(Node->Type == IMAGE_KIND)
  1251.                                 Node->Special.Image.BitMap = (struct BitMap *)ti_Data;
  1252.  
  1253.                             break;
  1254.  
  1255.                         case LAIM_BitMapMask:
  1256.  
  1257.                             if(Node->Type == IMAGE_KIND)
  1258.                                 Node->Special.Image.BitMapMask = (PLANEPTR)ti_Data;
  1259.  
  1260.                             break;
  1261.  
  1262.                         case LAIM_BitMapLeft:
  1263.  
  1264.                             if(Node->Type == IMAGE_KIND)
  1265.                                 Node->Special.Image.BitMapLeft = ti_Data;
  1266.  
  1267.                             break;
  1268.  
  1269.                         case LAIM_BitMapTop:
  1270.  
  1271.                             if(Node->Type == IMAGE_KIND)
  1272.                                 Node->Special.Image.BitMapTop = ti_Data;
  1273.  
  1274.                             break;
  1275.  
  1276.                         case LAIM_BitMapWidth:
  1277.  
  1278.                             if(Node->Type == IMAGE_KIND)
  1279.                                 Node->Special.Image.BitMapWidth = ti_Data;
  1280.  
  1281.                             break;
  1282.  
  1283.                         case LAIM_BitMapHeight:
  1284.  
  1285.                             if(Node->Type == IMAGE_KIND)
  1286.                                 Node->Special.Image.BitMapHeight = ti_Data;
  1287.  
  1288.                             break;
  1289.  
  1290.                         case LAFR_RefreshHook:
  1291.  
  1292.                             if(Type == FRAME_KIND)
  1293.                                 Node->Special.Frame.RefreshHook = (struct Hook *)ti_Data;
  1294.  
  1295.                             break;
  1296.  
  1297.                         case LAFR_InnerWidth:
  1298.  
  1299.                             if(Type == FRAME_KIND)
  1300.                                 Node->Special.Frame.InnerWidth = ti_Data;
  1301.  
  1302.                             break;
  1303.  
  1304.                         case LAFR_InnerHeight:
  1305.  
  1306.                             if(Type == FRAME_KIND)
  1307.                                 Node->Special.Frame.InnerHeight = ti_Data;
  1308.  
  1309.                             break;
  1310.  
  1311.                         case LA_DrawBox:
  1312.  
  1313.                             if(Type == FRAME_KIND)
  1314.                                 Node->Special.Frame.DrawBox = ti_Data;
  1315.  
  1316.                             if(Type == BOX_KIND)
  1317.                                 Node->Special.Box.DrawBox = ti_Data;
  1318.  
  1319.                             break;
  1320.  
  1321.                         case LAFR_GenerateEvents:
  1322.  
  1323.                             if(Type == FRAME_KIND)
  1324.                                 Node->Special.Frame.GenerateEvents = ti_Data;
  1325.  
  1326.                             break;
  1327.  
  1328.                         case LABX_AlignText:
  1329.  
  1330.                             if(Type == BOX_KIND)
  1331.                                 Node->Special.Box.AlignText = ti_Data;
  1332.  
  1333.                             break;
  1334.  
  1335.                         case LABX_Line:
  1336.  
  1337.                             if(Type == BOX_KIND)
  1338.                                 BoxLine = (STRPTR)ti_Data;
  1339.  
  1340.                             break;
  1341.  
  1342.                         case LABX_LineID:
  1343.  
  1344.                             if(Type == BOX_KIND)
  1345.                             {
  1346.                                 if(Handle->LocaleHook)
  1347.                                     BoxLine = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)ti_Data);
  1348.                                 else
  1349.                                     Handle->Failed = TRUE;
  1350.                             }
  1351.  
  1352.                             break;
  1353.  
  1354.                         case LABX_Labels:
  1355.  
  1356.                             if(Type == BOX_KIND)
  1357.                             {
  1358.                                 STRPTR    *Labels = (STRPTR *)ti_Data;
  1359.                                 LONG     Count    = 0;
  1360.  
  1361.                                 while(Labels[Count])
  1362.                                     Count++;
  1363.  
  1364.                                 if(Node->Lines != Count)
  1365.                                 {
  1366.                                     LTP_Free(Handle,Node->Special.Box.Lines,sizeof(STRPTR) * Node->Lines);
  1367.  
  1368.                                     Node->Special.Box.Lines = NULL;
  1369.                                 }
  1370.  
  1371.                                 if(Count)
  1372.                                 {
  1373.                                     if(!Node->Special.Box.Lines)
  1374.                                     {
  1375.                                         if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  1376.                                         {
  1377.                                             LONG i;
  1378.  
  1379.                                             for(i = 0 ; i < Count ; i++)
  1380.                                                 Node->Special.Box.Lines[i] = "";
  1381.                                         }
  1382.                                     }
  1383.                                 }
  1384.  
  1385.                                 Node->Lines = Count;
  1386.  
  1387.                                 Node->Special.Box.Labels = Labels;
  1388.                             }
  1389.  
  1390.                             break;
  1391.  
  1392.                         case LABX_Lines:
  1393.  
  1394.                             if(Type == BOX_KIND)
  1395.                             {
  1396.                                 STRPTR    *Lines = (STRPTR *)ti_Data;
  1397.                                 LONG     Count = 0;
  1398.  
  1399.                                 while(Lines[Count])
  1400.                                     Count++;
  1401.  
  1402.                                 if(Node->Lines && Count > Node->Lines)
  1403.                                     Count = Node->Lines;
  1404.  
  1405.                                 if(Count)
  1406.                                 {
  1407.                                     if(!Node->Special.Box.Lines)
  1408.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  1409.  
  1410.                                     if(Node->Special.Box.Lines)
  1411.                                     {
  1412.                                         LONG i;
  1413.  
  1414.                                         for(i = 0 ; i < Count ; i++)
  1415.                                             Node->Special.Box.Lines[i] = Lines[i];
  1416.                                     }
  1417.                                 }
  1418.  
  1419.                                 Node->Lines = Count;
  1420.                             }
  1421.  
  1422.                             break;
  1423.  
  1424.                         case LABX_LineTable:
  1425.  
  1426.                             if(Type == BOX_KIND)
  1427.                                 LineTable = (LONG *)ti_Data;
  1428.  
  1429.                             break;
  1430.  
  1431.                         case LABX_FirstLine:
  1432.  
  1433.                             if(Type == BOX_KIND)
  1434.                                 FirstLine = ti_Data;
  1435.  
  1436.                             break;
  1437.  
  1438.                         case LABX_LastLine:
  1439.  
  1440.                             if(Type == BOX_KIND)
  1441.                                 LastLine = ti_Data;
  1442.  
  1443.                             break;
  1444.  
  1445.                         case GA_Disabled:
  1446.  
  1447.                             Node->Disabled = ti_Data;
  1448.                             break;
  1449.  
  1450.                         case GTCB_Checked:
  1451.  
  1452.                             if(Type == CHECKBOX_KIND)
  1453.                                 Node->Current = ti_Data;
  1454.  
  1455.                             break;
  1456.  
  1457.                         case GTLV_Labels:
  1458.  
  1459.                             if(Type == LISTVIEW_KIND)
  1460.                             {
  1461.                                 if(ti_Data)
  1462.                                     Node->Special.List.Labels = (struct List *)ti_Data;
  1463.                                 else
  1464.                                     Node->Special.List.Labels = (struct List *)<P_EmptyList;
  1465.                             }
  1466.  
  1467.                             break;
  1468.  
  1469.                         case GTLV_ReadOnly:
  1470.  
  1471.                             if(Type == LISTVIEW_KIND)
  1472.                                 Node->Special.List.ReadOnly = ti_Data;
  1473.  
  1474.                             break;
  1475.  
  1476.                         case GTLV_Selected:
  1477.                         case LALV_Selected:
  1478.  
  1479.                             if(Type == LISTVIEW_KIND)
  1480.                                 Node->Current = (LONG)ti_Data;
  1481.  
  1482.                             break;
  1483.  
  1484.                         case GTLV_CallBack:
  1485.  
  1486.                             if(Type == LISTVIEW_KIND)
  1487.                                 Node->Special.List.CallBack = (struct Hook *)ti_Data;
  1488.  
  1489.                             break;
  1490.  
  1491.                         case GTLV_MaxPen:
  1492.  
  1493.                             if(Type == LISTVIEW_KIND)
  1494.                                 Node->Special.List.MaxPen = ti_Data;
  1495.  
  1496.                             break;
  1497.  
  1498.                         case GTMX_Labels:
  1499.  
  1500.                             if(Type == MX_KIND)
  1501.                                 Node->Special.Radio.Choices = (STRPTR *)ti_Data;
  1502.  
  1503.                             break;
  1504.  
  1505.                         case GTMX_Active:
  1506.  
  1507.                             if(Type == MX_KIND)
  1508.                                 Node->Current = ti_Data;
  1509.  
  1510.                             break;
  1511.  
  1512.                         case GTMX_TitlePlace:
  1513.  
  1514.                             if(Type == MX_KIND && Label)
  1515.                             {
  1516.                                 if(ti_Data == PLACE_RIGHT)
  1517.                                     Node->Special.Radio.TitlePlace = PLACETEXT_RIGHT;
  1518.                                 else
  1519.                                     Node->Special.Radio.TitlePlace = PLACETEXT_LEFT;
  1520.                             }
  1521.  
  1522.                             break;
  1523.  
  1524.                         case GTTX_Text:
  1525.  
  1526.                             if(Type == TEXT_KIND)
  1527.                                 Node->Special.Text.Text = (STRPTR)ti_Data;
  1528.  
  1529.                             break;
  1530.  
  1531.                         case GTTX_FrontPen:
  1532.  
  1533.                             if(Type == TEXT_KIND)
  1534.                                 Node->Special.Text.FrontPen = (WORD)ti_Data;
  1535.  
  1536.                             if(Type == NUMBER_KIND)
  1537.                                 Node->Special.Number.FrontPen = (WORD)ti_Data;
  1538.  
  1539.                             break;
  1540.  
  1541.                         case GTTX_BackPen:
  1542.  
  1543.                             if(Type == TEXT_KIND)
  1544.                                 Node->Special.Text.BackPen = (WORD)ti_Data;
  1545.  
  1546.                             if(Type == NUMBER_KIND)
  1547.                                 Node->Special.Number.BackPen = (WORD)ti_Data;
  1548.  
  1549.                             break;
  1550.  
  1551.                         case GTTX_CopyText:
  1552.  
  1553.                             if(Type == TEXT_KIND)
  1554.                                 Node->Special.Text.CopyText = ti_Data;
  1555.  
  1556.                             break;
  1557.  
  1558.                         case GTTX_Border:
  1559.  
  1560.                             if(Type == TEXT_KIND)
  1561.                                 Node->Special.Text.Border = ti_Data;
  1562.  
  1563.                             break;
  1564.  
  1565.                         case GTNM_Number:
  1566.  
  1567.                             if(Type == NUMBER_KIND)
  1568.                                 Node->Special.Number.Number = ti_Data;
  1569.  
  1570.                             break;
  1571.  
  1572.                         case GTNM_MaxNumberLen:
  1573.  
  1574.                             if(Type == NUMBER_KIND)
  1575.                                 Node->Special.Number.MaxNumberLen = ti_Data;
  1576.  
  1577.                             break;
  1578.  
  1579.                         case GTNM_Format:
  1580.  
  1581.                             if(Type == NUMBER_KIND)
  1582.                                 Node->Special.Number.Format = (STRPTR)ti_Data;
  1583.  
  1584.                             break;
  1585.  
  1586.                         case GTNM_Border:
  1587.  
  1588.                             if(Type == NUMBER_KIND)
  1589.                                 Node->Special.Number.Border = ti_Data;
  1590.  
  1591.                             break;
  1592.  
  1593.                         case GTTX_Justification:
  1594.  
  1595.                             if(Type == NUMBER_KIND)
  1596.                                 Node->Special.Number.Justification = ti_Data;
  1597.  
  1598.                             if(Type == TEXT_KIND)
  1599.                                 Node->Special.Text.Justification = ti_Data;
  1600.  
  1601.                             break;
  1602.  
  1603.                         case LAPU_CentreActive:
  1604.  
  1605.                             if(Type == POPUP_KIND)
  1606.                                 Node->Special.Popup.CentreActive = ti_Data;
  1607.  
  1608.                             break;
  1609.  
  1610.                         case GTCY_Labels:
  1611.  
  1612.                             if(Type == CYCLE_KIND)
  1613.                                 Node->Special.Cycle.Choices = (STRPTR *)ti_Data;
  1614.  
  1615.                             #ifdef DO_POPUP_KIND
  1616.                             {
  1617.                                 if(Type == POPUP_KIND)
  1618.                                     Node->Special.Popup.Choices = (STRPTR *)ti_Data;
  1619.                             }
  1620.                             #endif
  1621.  
  1622.                             #ifdef DO_TAB_KIND
  1623.                             {
  1624.                                 if(Type == TAB_KIND)
  1625.                                     Node->Special.Tab.Choices = (STRPTR *)ti_Data;
  1626.                             }
  1627.                             #endif
  1628.  
  1629.                             break;
  1630.  
  1631.                         case GTCY_Active:
  1632.  
  1633.                             if(Type == CYCLE_KIND)
  1634.                                 Node->Current = ti_Data;
  1635.  
  1636.                             #ifdef DO_POPUP_KIND
  1637.                             {
  1638.                                 if(Type == POPUP_KIND)
  1639.                                     Node->Current = ti_Data;
  1640.                             }
  1641.                             #endif
  1642.  
  1643.                             #ifdef DO_TAB_KIND
  1644.                             {
  1645.                                 if(Type == TAB_KIND)
  1646.                                     Node->Current = ti_Data;
  1647.                             }
  1648.                             #endif
  1649.  
  1650.                             break;
  1651.  
  1652.                         case GTPA_Depth:
  1653.  
  1654.                             if(Type == PALETTE_KIND)
  1655.                             {
  1656.                                 Node->Special.Palette.Depth = ti_Data;
  1657.  
  1658.                                 if(Handle->MaxPen < (1L << Node->Special.Palette.Depth) - 1)
  1659.                                     Handle->MaxPen = (1L << Node->Special.Palette.Depth) - 1;
  1660.                             }
  1661.  
  1662.                             break;
  1663.  
  1664.                         case GTPA_Color:
  1665.  
  1666.                             if(Type == PALETTE_KIND)
  1667.                                 Node->Current = ti_Data;
  1668.  
  1669.                             break;
  1670.  
  1671.                         case GTPA_ColorOffset:
  1672.  
  1673.                             if(Type == PALETTE_KIND)
  1674.                                 Node->Min = ti_Data;
  1675.  
  1676.                             break;
  1677.  
  1678.                         case GTPA_NumColors:
  1679.  
  1680.                             if(Type == PALETTE_KIND)
  1681.                             {
  1682.                                 Node->Special.Palette.NumColours = ti_Data;
  1683.  
  1684.                                 if(Node->Special.Palette.ColourTable)
  1685.                                 {
  1686.                                     LONG i;
  1687.  
  1688.                                     for(i = 0 ; i < Node->Special.Palette.NumColours ; i++)
  1689.                                     {
  1690.                                         if(Node->Special.Palette.ColourTable[i] > Handle->MaxPen)
  1691.                                             Handle->MaxPen = Node->Special.Palette.ColourTable[i];
  1692.                                     }
  1693.                                 }
  1694.                             }
  1695.  
  1696.                             break;
  1697.  
  1698.                         case GTPA_ColorTable:
  1699.  
  1700.                             if(Type == PALETTE_KIND)
  1701.                             {
  1702.                                 Node->Special.Palette.ColourTable = (UBYTE *)ti_Data;
  1703.  
  1704.                                 if(Node->Special.Palette.NumColours)
  1705.                                 {
  1706.                                     LONG i;
  1707.  
  1708.                                     for(i = 0 ; i < Node->Special.Palette.NumColours ; i++)
  1709.                                     {
  1710.                                         if(Node->Special.Palette.ColourTable[i] > Handle->MaxPen)
  1711.                                             Handle->MaxPen = Node->Special.Palette.ColourTable[i];
  1712.                                     }
  1713.                                 }
  1714.                             }
  1715.  
  1716.                             break;
  1717.  
  1718.                         case GA_RelVerify:
  1719.  
  1720.                             if(Type == SCROLLER_KIND)
  1721.                                 Node->Special.Scroller.RelVerify = ti_Data;
  1722.  
  1723.                             break;
  1724.  
  1725.                         case GA_Immediate:
  1726.  
  1727.                             if(Type == SCROLLER_KIND)
  1728.                                 Node->Special.Scroller.Immediate = ti_Data;
  1729.  
  1730.                             break;
  1731.  
  1732.                         case GTSC_Top:
  1733.  
  1734.                             if(Type == SCROLLER_KIND)
  1735.                                 Node->Current = ti_Data;
  1736.  
  1737.                             break;
  1738.  
  1739.                         case GTSC_Total:
  1740.  
  1741.                             if(Type == SCROLLER_KIND)
  1742.                                 Node->Max = ti_Data;
  1743.  
  1744.                             break;
  1745.  
  1746.                         case GTSC_Visible:
  1747.  
  1748.                             if(Type == SCROLLER_KIND)
  1749.                                 Node->Special.Scroller.Visible = ti_Data;
  1750.  
  1751.                             break;
  1752.  
  1753.                         case GTSC_Arrows:
  1754.  
  1755.                             if(Type == SCROLLER_KIND)
  1756.                                 Node->Special.Scroller.Arrows = (ti_Data != 0);
  1757.  
  1758.                             break;
  1759.  
  1760.                         case LASC_Thin:
  1761.  
  1762.                             if(Type == SCROLLER_KIND)
  1763.                                 Node->Special.Scroller.Thin = ti_Data;
  1764.  
  1765.                             break;
  1766.  
  1767.                         case LASC_FullSize:
  1768.  
  1769.                             if(Type == SCROLLER_KIND)
  1770.                             {
  1771.                                 Node->Special.Scroller.FullSize = ti_Data;
  1772.                                 Node->Special.Scroller.Parent = Handle->CurrentGroup;
  1773.                             }
  1774.  
  1775.                             break;
  1776.  
  1777.                         case PGA_Freedom:
  1778.  
  1779.                             if(Type == SCROLLER_KIND)
  1780.                                 Node->Special.Scroller.Vertical = (ti_Data == LORIENT_VERT);
  1781.  
  1782.                             #ifdef DO_LEVEL_KIND
  1783.                             {
  1784.                                 if(Type == LEVEL_KIND)
  1785.                                     Node->Special.Level.Freedom = (ti_Data == FREEVERT) ? FREEVERT : FREEHORIZ;
  1786.                             }
  1787.                             #endif /* DO_LEVEL_KIND */
  1788.  
  1789.                             break;
  1790.  
  1791.                         #ifdef DO_LEVEL_KIND
  1792.                         {
  1793.                             case LAVL_Freedom:
  1794.  
  1795.                                 if(Type == LEVEL_KIND)
  1796.                                     Node->Special.Level.Freedom = (ti_Data == FREEVERT) ? FREEVERT : FREEHORIZ;
  1797.  
  1798.                                 break;
  1799.  
  1800.                             case LAVL_Ticks:
  1801.  
  1802.                                 if(Type == LEVEL_KIND)
  1803.                                     Node->Special.Level.Ticks = ti_Data;
  1804.  
  1805.                                 break;
  1806.  
  1807.                             case LAVL_NumTicks:
  1808.  
  1809.                                 if(Type == LEVEL_KIND)
  1810.                                     Node->Special.Level.NumTicks = ti_Data;
  1811.  
  1812.                                 break;
  1813.                         }
  1814.                         #endif    /* DO_LEVEL_KIND */
  1815.  
  1816.                         case GTSL_Min:
  1817.  
  1818.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1819.                                 Node->Min = ti_Data;
  1820.  
  1821.                             break;
  1822.  
  1823.                         case GTSL_Max:
  1824.  
  1825.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1826.                                 Node->Max = ti_Data;
  1827.  
  1828.                             break;
  1829.  
  1830.                         case GTSL_Level:
  1831.  
  1832.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1833.                                 Node->Current = ti_Data;
  1834.  
  1835.                             break;
  1836.  
  1837.                         case GTSL_LevelFormat:
  1838.  
  1839.                             #ifdef DO_LEVEL_KIND
  1840.                             {
  1841.                                 if(Type == LEVEL_KIND)
  1842.                                     Node->Special.Level.LevelFormat = (STRPTR)ti_Data;
  1843.                             }
  1844.                             #endif    /* DO_LEVEL_KIND */
  1845.  
  1846.                             if(Type == SLIDER_KIND)
  1847.                                 Node->Special.Slider.LevelFormat = (STRPTR)ti_Data;
  1848.  
  1849.                             break;
  1850.  
  1851.                         case GTSL_LevelPlace:
  1852.  
  1853.                             #ifdef DO_LEVEL_KIND
  1854.                             {
  1855.                                 if(Type == LEVEL_KIND)
  1856.                                 {
  1857.                                     if(ti_Data == PLACE_RIGHT)
  1858.                                         Node->Special.Level.LevelPlace = PLACETEXT_RIGHT;
  1859.                                     else
  1860.                                         Node->Special.Level.LevelPlace = PLACETEXT_LEFT;
  1861.                                 }
  1862.                             }
  1863.                             #endif    /* DO_LEVEL_KIND */
  1864.  
  1865.                             if(Type == SLIDER_KIND)
  1866.                             {
  1867.                                 if(ti_Data == PLACE_RIGHT)
  1868.                                     Node->Special.Slider.LevelPlace = PLACETEXT_RIGHT;
  1869.                                 else
  1870.                                     Node->Special.Slider.LevelPlace = PLACETEXT_LEFT;
  1871.                             }
  1872.  
  1873.                             break;
  1874.  
  1875.                         case GTSL_DispFunc:
  1876.  
  1877.                             #ifdef DO_LEVEL_KIND
  1878.                             {
  1879.                                 if(Type == LEVEL_KIND)
  1880.                                     Node->Special.Level.DispFunc = (DISPFUNC)ti_Data;
  1881.                             }
  1882.                             #endif    /* DO_LEVEL_KIND */
  1883.  
  1884.                             if(Type == SLIDER_KIND)
  1885.                                 Node->Special.Slider.DispFunc = (DISPFUNC)ti_Data;
  1886.  
  1887.                             break;
  1888.  
  1889.                         case LASL_FullCheck:
  1890.  
  1891.                             if(Type == SLIDER_KIND)
  1892.                                 Node->Special.Slider.FullLevelCheck = ti_Data;
  1893.  
  1894.                             #ifdef DO_LEVEL_KIND
  1895.                             {
  1896.                                 if(Type == LEVEL_KIND)
  1897.                                     Node->Special.Level.FullLevelCheck = ti_Data;
  1898.                             }
  1899.                             #endif    /* DO_LEVEL_KIND */
  1900.  
  1901.                             break;
  1902.  
  1903.                         case GTST_String:
  1904.  
  1905.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1906.                                 Node->Special.String.String = (STRPTR)ti_Data;
  1907.  
  1908.                             #ifdef DO_TEXTEDIT_KIND
  1909.                             {
  1910.                                 if(Type == TEXTEDIT_KIND)
  1911.                                     Node->Special.TextEdit.String = (STRPTR)ti_Data;
  1912.                             }
  1913.                             #endif /* DO_TEXTEDIT_KIND */
  1914.  
  1915.                             break;
  1916.  
  1917.                         case LAST_Activate:
  1918.  
  1919.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1920.                                 Node->Special.String.Activate = ti_Data;
  1921.  
  1922.                             if(Type == INTEGER_KIND)
  1923.                                 Node->Special.Integer.Activate = ti_Data;
  1924.  
  1925.                             #ifdef DO_TEXTEDIT_KIND
  1926.                             {
  1927.                                 if(Type == TEXTEDIT_KIND)
  1928.                                     Node->Special.TextEdit.Activate = ti_Data;
  1929.                             }
  1930.                             #endif /* DO_TEXTEDIT_KIND */
  1931.  
  1932.                             break;
  1933.  
  1934.                         case GTST_MaxChars:
  1935.  
  1936.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1937.                                 Node->Special.String.MaxChars = ti_Data;
  1938.  
  1939.                             break;
  1940.  
  1941.                         case GTST_EditHook:
  1942.  
  1943.                             if(Type == STRING_KIND)
  1944.                                 Node->Special.String.EditHook = (struct Hook *)ti_Data;
  1945.                             else
  1946.                             {
  1947.                                 if(Type == INTEGER_KIND)
  1948.                                 {
  1949.                                     if(Node->Special.Integer.EditHook = (struct Hook *)ti_Data)
  1950.                                         Node->Special.Integer.CustomHook = TRUE;
  1951.                                 }
  1952.                             }
  1953.  
  1954.                             break;
  1955.  
  1956.                         case LAST_ValidateHook:
  1957.  
  1958.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1959.                                 Node->Special.String.ValidateHook = (struct Hook *)ti_Data;
  1960.                             else
  1961.                             {
  1962.                                 if(Type == INTEGER_KIND)
  1963.                                     Node->Special.Integer.ValidateHook = (struct Hook *)ti_Data;
  1964.                             }
  1965.  
  1966.                             break;
  1967.  
  1968.                         case STRINGA_Justification:
  1969.  
  1970.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1971.                                 Node->Special.String.Justification = ti_Data;
  1972.                             else
  1973.                             {
  1974.                                 if(Type == INTEGER_KIND)
  1975.                                     Node->Special.Integer.Justification = ti_Data;
  1976.                             }
  1977.  
  1978.                             break;
  1979.  
  1980.                         case LAIN_UseIncrementers:
  1981.  
  1982.                             if(Type == INTEGER_KIND)
  1983.                             {
  1984.                                 if(Node->Special.Integer.UseIncrementers = ti_Data)
  1985.                                     Handle->IDCMP |= IDCMP_INTUITICKS;
  1986.                             }
  1987.  
  1988.                             break;
  1989.  
  1990.                         case GTIN_Number:
  1991.  
  1992.                             if(Type == INTEGER_KIND)
  1993.                                 Node->Special.Integer.Number = ti_Data;
  1994.  
  1995.                             break;
  1996.  
  1997.                         case GTIN_MaxChars:
  1998.  
  1999.                             if(Type == INTEGER_KIND)
  2000.                                 Node->Special.Integer.MaxChars = ti_Data;
  2001.  
  2002.                             break;
  2003.                     }
  2004.                 }
  2005.             }
  2006.  
  2007.             if(Handle->Failed)
  2008.                 return;
  2009.  
  2010.             switch(Type)
  2011.             {
  2012.                 case STRING_KIND:
  2013.                 case INTEGER_KIND:
  2014.                 case FRACTION_KIND:
  2015.  
  2016.                     if(Node->Special.String.MaxHistoryLines)
  2017.                     {
  2018.                         if(!Node->Special.Integer.HistoryHook)
  2019.                         {
  2020.                             struct Hook *Hook;
  2021.  
  2022.                             if(Hook = (struct Hook *)LTP_Alloc(Handle,sizeof(struct Hook) + sizeof(struct MinList)))
  2023.                             {
  2024.                                 struct MinList *List;
  2025.  
  2026.                                 List = Hook->h_Data = (APTR)(Hook + 1);
  2027.  
  2028.                                 NewList((struct List *)List);
  2029.  
  2030.                                 Hook->h_Entry = (HOOKFUNC)LTP_DefaultHistoryHook;
  2031.  
  2032.                                 Node->Special.Integer.HistoryHook = Hook;
  2033.                             }
  2034.                         }
  2035.  
  2036.                         if(Node->Special.Integer.HistoryHook)
  2037.                         {
  2038.                             struct Node    *TextNode;
  2039.                             struct MinList *List;
  2040.  
  2041.                             List = (struct List *)Node->Special.Integer.HistoryHook->h_Data;
  2042.  
  2043.                             Node->Special.Integer.LayoutHandle = Handle;
  2044.                             Node->Special.Integer.NumHistoryLines = 0;
  2045.  
  2046.                             TextNode = (struct Node *)List->mlh_Head;
  2047.  
  2048.                             while(TextNode->ln_Succ)
  2049.                             {
  2050.                                 Node->Special.Integer.NumHistoryLines++;
  2051.  
  2052.                                 TextNode = TextNode->ln_Succ;
  2053.                             }
  2054.                         }
  2055.                     }
  2056.  
  2057.                     break;
  2058.  
  2059.                 #ifdef DO_TEXTEDIT_KIND
  2060.                 {
  2061.                     case TEXTEDIT_KIND:
  2062.  
  2063.                         break;
  2064.                 }
  2065.                 #endif /* DO_TEXTEDIT_KIND */
  2066.  
  2067.                 #ifdef DO_TAB_KIND
  2068.                 {
  2069.                     case TAB_KIND:
  2070.  
  2071.                         Node->Special.Tab.Parent = Handle->CurrentGroup;
  2072.                         break;
  2073.                 }
  2074.                 #endif
  2075.  
  2076.                 #ifdef DO_BOOPSI_KIND
  2077.                 {
  2078.                     case BOOPSI_KIND:
  2079.  
  2080.                         Node->Special.BOOPSI.Parent = Handle->CurrentGroup;
  2081.  
  2082.                         if(Node->Special.BOOPSI.ClassTags = CloneTagItems(TagList))
  2083.                         {
  2084.                             STATIC const Tag Exclude[] =
  2085.                             {
  2086.                                 LA_Chars,
  2087.                                 LA_Lines,
  2088.                                 LABO_TagCurrent,
  2089.                                 LABO_TagTextAttr,
  2090.                                 LABO_TagDrawInfo,
  2091.                                 LABO_ClassInstance,
  2092.                                 LABO_ClassName,
  2093.                                 LABO_ClassLibraryName,
  2094.                                 LABO_ExactWidth,
  2095.                                 LABO_ExactHeight,
  2096.  
  2097.                                 TAG_DONE
  2098.                             };
  2099.  
  2100.                             FilterTagItems(Node->Special.BOOPSI.ClassTags,(Tag *)Exclude,TAGFILTER_NOT);
  2101.                         }
  2102.                         else
  2103.                             Handle->Failed = TRUE;
  2104.  
  2105.                         break;
  2106.                 }
  2107.                 #endif    /* DO_BOOPSI_KIND */
  2108.  
  2109.                 case TEXT_KIND:
  2110.  
  2111.                     if(Node->Special.Text.CopyText && Node->Special.Text.Text)
  2112.                     {
  2113.                         STRPTR text;
  2114.  
  2115.                         if(text = LTP_Alloc(Handle,strlen(Node->Special.Text.Text) + 1))
  2116.                         {
  2117.                             strcpy(text,Node->Special.Text.Text);
  2118.  
  2119.                             Node->Special.Text.Text = text;
  2120.                         }
  2121.                     }
  2122.  
  2123.                     break;
  2124.  
  2125.                 case BOX_KIND:
  2126.  
  2127.                     if(FirstLine != -1 && LastLine != -1)
  2128.                     {
  2129.                         if(FirstLine <= LastLine && Handle->LocaleHook)
  2130.                         {
  2131.                             LONG Count = LastLine - FirstLine + 1;
  2132.  
  2133.                             if(Node->Lines && Count > Node->Lines)
  2134.                                 Count = Node->Lines;
  2135.                             else
  2136.                                 Node->Lines = Count;
  2137.  
  2138.                             if(Count)
  2139.                             {
  2140.                                 if(!Node->Special.Box.Lines)
  2141.                                     Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  2142.  
  2143.                                 if(Node->Special.Box.Lines)
  2144.                                 {
  2145.                                     LONG i;
  2146.  
  2147.                                     for(i = 0 ; i < Count ; i++)
  2148.                                         Node->Special.Box.Lines[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLine + i));
  2149.                                 }
  2150.                             }
  2151.                         }
  2152.                         else
  2153.                             Handle->Failed = TRUE;
  2154.                     }
  2155.                     else
  2156.                     {
  2157.                         if(LineTable)
  2158.                         {
  2159.                             if(Handle->LocaleHook)
  2160.                             {
  2161.                                 LONG Count = 0;
  2162.  
  2163.                                 while(LineTable[Count] != -1)
  2164.                                     Count++;
  2165.  
  2166.                                 if(Node->Lines && Count > Node->Lines)
  2167.                                     Count = Node->Lines;
  2168.                                 else
  2169.                                     Node->Lines = Count;
  2170.  
  2171.                                 if(Count)
  2172.                                 {
  2173.                                     if(!Node->Special.Box.Lines)
  2174.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  2175.  
  2176.                                     if(Node->Special.Box.Lines)
  2177.                                     {
  2178.                                         LONG i;
  2179.  
  2180.                                         for(i = 0 ; i < Count ; i++)
  2181.                                             Node->Special.Box.Lines[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(LineTable[i]));
  2182.                                     }
  2183.                                 }
  2184.                             }
  2185.                             else
  2186.                                 Handle->Failed = TRUE;
  2187.                         }
  2188.                         else
  2189.                         {
  2190.                             if(BoxLine)
  2191.                             {
  2192.                                 LONG Count,i;
  2193.  
  2194.                                 for(i = 0, Count = 1 ; i < strlen(BoxLine) ; i++)
  2195.                                 {
  2196.                                     if(BoxLine[i] == '\n')
  2197.                                         Count++;
  2198.                                 }
  2199.  
  2200.                                 if(Node->Lines && Count > Node->Lines)
  2201.                                     Count = Node->Lines;
  2202.                                 else
  2203.                                     Node->Lines = Count;
  2204.  
  2205.                                 if(Count)
  2206.                                 {
  2207.                                     if(!Node->Special.Box.Lines)
  2208.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  2209.  
  2210.                                     if(Node->Special.Box.Lines)
  2211.                                     {
  2212.                                         STRPTR From,To;
  2213.                                         LONG Len;
  2214.  
  2215.                                         From = BoxLine;
  2216.  
  2217.                                         for(i = 0 ; i < Count ; i++)
  2218.                                         {
  2219.                                             for(To = From ; *To ; To++)
  2220.                                             {
  2221.                                                 if(*To == '\n')
  2222.                                                     break;
  2223.                                             }
  2224.  
  2225.                                             Len = (LONG)(To - From);
  2226.  
  2227.                                             if(Node->Special.Box.Lines[i] = LTP_Alloc(Handle,Len + 1))
  2228.                                             {
  2229.                                                 if(Len)
  2230.                                                     CopyMem(From,Node->Special.Box.Lines[i],Len);
  2231.  
  2232.                                                 Node->Special.Box.Lines[i][Len] = 0;
  2233.  
  2234.                                                 From = To + 1;
  2235.                                             }
  2236.                                         }
  2237.                                     }
  2238.                                 }
  2239.                             }
  2240.                         }
  2241.                     }
  2242.  
  2243.                     break;
  2244.             }
  2245.  
  2246.             if((FirstLabel != -1 && LastLabel != -1) || LabelTable)
  2247.             {
  2248.                 if(!Handle->LocaleHook)
  2249.                     Handle->Failed = TRUE;
  2250.                 else
  2251.                 {
  2252.                     if(Type == LISTVIEW_KIND)
  2253.                     {
  2254.                         struct List *SomeList;
  2255.  
  2256.                         if(SomeList = (struct List *)LTP_Alloc(Handle,sizeof(struct MinList)))
  2257.                         {
  2258.                             struct Node    *SomeNode;
  2259.                             LONG         Count = (LastLabel - FirstLabel + 1),i;
  2260.  
  2261.                             NewList(SomeList);
  2262.  
  2263.                             Node->Special.List.Labels = SomeList;
  2264.  
  2265.                             if(LabelTable)
  2266.                             {
  2267.                                 while(*LabelTable != -1)
  2268.                                 {
  2269.                                     if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node)))
  2270.                                     {
  2271.                                         SomeNode->ln_Name = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(*LabelTable++));
  2272.  
  2273.                                         AddTail(SomeList,SomeNode);
  2274.                                     }
  2275.                                 }
  2276.                             }
  2277.                             else
  2278.                             {
  2279.                                 for(i = 0 ; i < Count ; i++)
  2280.                                 {
  2281.                                     if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node)))
  2282.                                     {
  2283.                                         SomeNode->ln_Name = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLabel + i));
  2284.  
  2285.                                         AddTail(SomeList,SomeNode);
  2286.                                     }
  2287.                                 }
  2288.                             }
  2289.                         }
  2290.                     }
  2291.                     else
  2292.                     {
  2293.                         if(Type == MX_KIND || Type == CYCLE_KIND || Type == POPUP_KIND || Type == TAB_KIND || Type == BOX_KIND || Type == BUTTON_KIND)
  2294.                         {
  2295.                             STRPTR    *Labels;
  2296.                             LONG     Count,i;
  2297.  
  2298.                             if(LabelTable)
  2299.                             {
  2300.                                 LONG *Index = LabelTable;
  2301.  
  2302.                                 for(Count = 0 ; *Index != -1 ; Count++, Index++);
  2303.                             }
  2304.                             else
  2305.                                 Count = (LastLabel - FirstLabel + 1);
  2306.  
  2307.                             if(Labels = LTP_Alloc(Handle,sizeof(STRPTR) * (Count + 1)))
  2308.                             {
  2309.                                 if(LabelTable)
  2310.                                 {
  2311.                                     for(i = 0 ; i < Count ; i++)
  2312.                                         Labels[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(*LabelTable++));
  2313.                                 }
  2314.                                 else
  2315.                                 {
  2316.                                     for(i = 0 ; i < Count ; i++)
  2317.                                         Labels[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLabel + i));
  2318.                                 }
  2319.  
  2320.                                 Labels[i] = NULL;
  2321.  
  2322.                                 switch(Type)
  2323.                                 {
  2324.                                     case BUTTON_KIND:
  2325.  
  2326.                                         Node->Special.Button.Lines = Labels;
  2327.                                         break;
  2328.  
  2329.                                     case MX_KIND:
  2330.  
  2331.                                         Node->Special.Radio.Choices = Labels;
  2332.                                         break;
  2333.  
  2334.                                     case CYCLE_KIND:
  2335.  
  2336.                                         Node->Special.Cycle.Choices = Labels;
  2337.                                         break;
  2338.  
  2339.                                     #ifdef DO_POPUP_KIND
  2340.                                     {
  2341.                                         case POPUP_KIND:
  2342.  
  2343.                                             Node->Special.Popup.Choices = Labels;
  2344.                                             break;
  2345.                                     }
  2346.                                     #endif
  2347.  
  2348.                                     #ifdef DO_TAB_KIND
  2349.                                     {
  2350.                                         case TAB_KIND:
  2351.  
  2352.                                             Node->Special.Tab.Choices = Labels;
  2353.                                             break;
  2354.                                     }
  2355.                                     #endif
  2356.  
  2357.                                     case BOX_KIND:
  2358.  
  2359.                                         if(!Node->Special.Box.Lines)
  2360.                                         {
  2361.                                             if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  2362.                                             {
  2363.                                                 LONG i;
  2364.  
  2365.                                                 for(i = 0 ; i < Count ; i++)
  2366.                                                     Node->Special.Box.Lines[i] = "";
  2367.                                             }
  2368.                                         }
  2369.  
  2370.                                         Node->Lines = Count;
  2371.  
  2372.                                         Node->Special.Box.Labels = Labels;
  2373.  
  2374.                                         break;
  2375.                                 }
  2376.                             }
  2377.                         }
  2378.                     }
  2379.                 }
  2380.             }
  2381.  
  2382.             switch(Type)
  2383.             {
  2384.                 case BUTTON_KIND:
  2385.  
  2386.                     if(!Node->NoKey && !Node->Special.Button.KeyStroke && (Node->Special.Button.Lines || Node->Special.Button.ReturnKey))
  2387.                     {
  2388.                         LTP_ReplaceLabelShortcut(Handle,Node);
  2389.                     }
  2390.  
  2391.                     break;
  2392.  
  2393.                 case BOX_KIND:
  2394.  
  2395.                     if(Node->Special.Box.ReserveSpace)
  2396.                     {
  2397.                         LONG    Size;
  2398.                         STRPTR    Buffer;
  2399.  
  2400.                         if(!Node->Special.Box.Lines)
  2401.                         {
  2402.                             if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Node->Lines))
  2403.                             {
  2404.                                 LONG i;
  2405.  
  2406.                                 for(i = 0 ; i < Node->Lines ; i++)
  2407.                                     Node->Special.Box.Lines[i] = "";
  2408.                             }
  2409.                         }
  2410.  
  2411.                         if(!Node->Chars)
  2412.                             Size = 10;
  2413.                         else
  2414.                             Size = Node->Chars;
  2415.  
  2416.                         Node->Special.Box.MaxSize = Size;
  2417.  
  2418.                         if(Buffer = (STRPTR)LTP_Alloc(Handle,(Size + 1) * Node->Lines))
  2419.                         {
  2420.                             LONG i,Len;
  2421.  
  2422.                             for(i = 0 ; i < Node->Lines ; i++)
  2423.                             {
  2424.                                 if(Node->Special.Box.Lines[i])
  2425.                                 {
  2426.                                     Len = strlen(Node->Special.Box.Lines[i]);
  2427.  
  2428.                                     if(Len > Size)
  2429.                                         Len = Size;
  2430.  
  2431.                                     CopyMem(Node->Special.Box.Lines[i],Buffer,Len);
  2432.  
  2433.                                     Buffer[Len] = 0;
  2434.                                 }
  2435.                                 else
  2436.                                     Buffer[0] = 0;
  2437.  
  2438.                                 Node->Special.Box.Lines[i] = Buffer;
  2439.  
  2440.                                 Buffer += Size + 1;
  2441.                             }
  2442.                         }
  2443.                     }
  2444.  
  2445.                     break;
  2446.  
  2447.                 case XBAR_KIND:
  2448.                 case YBAR_KIND:
  2449.  
  2450.                     Node->Special.Bar.Parent = Handle->CurrentGroup;
  2451.                     break;
  2452.  
  2453.                 #ifdef DO_PASSWORD_KIND
  2454.                 {
  2455.                     case PASSWORD_KIND:
  2456.                     {
  2457.                         STRPTR Buffer;
  2458.  
  2459.                         if(Buffer = LTP_Alloc(Handle,2 * (Node->Special.String.MaxChars + 1)))
  2460.                         {
  2461.                             Node->Special.String.RealString    = Buffer;
  2462.                             Node->Special.String.Original    = Buffer + Node->Special.String.MaxChars + 1;
  2463.  
  2464.                             if(Node->Special.String.String)
  2465.                             {
  2466.                                 strcpy(Node->Special.String.RealString,Node->Special.String.String);
  2467.                                 strcpy(Node->Special.String.Original,Node->Special.String.String);
  2468.                             }
  2469.                         }
  2470.  
  2471.                         break;
  2472.                     }
  2473.                 }
  2474.                 #endif
  2475.  
  2476.                 case FRACTION_KIND:
  2477.  
  2478.                     Node->Special.String.RealString = LTP_Alloc(Handle,Node->Special.String.MaxChars + 1);
  2479.                     break;
  2480.             }
  2481.  
  2482.             if(ParentList)
  2483.                 AddTail((struct List *)ParentList,(struct Node *)Node);
  2484.         }
  2485.     }
  2486. }
  2487.  
  2488.  
  2489. /*****************************************************************************/
  2490.  
  2491.  
  2492. /****** gtlayout.library/LT_NewA ******************************************
  2493. *
  2494. *   NAME
  2495. *    LT_NewA -- Add a new object to the user interface tree.
  2496. *
  2497. *   SYNOPSIS
  2498. *    LT_NewA(Handle,Tags);
  2499. *             A0    A1
  2500. *
  2501. *    VOID LT_NewA(LayoutHandle *,struct TagItem *);
  2502. *
  2503. *    LT_New(Handle,...);
  2504. *
  2505. *    VOID LT_New(LayoutHandle *,...);
  2506. *
  2507. *   FUNCTION
  2508. *    LT_NewA() is the routine you use to build the user interface,
  2509. *    you give layout directions, design groups, etc. and finally
  2510. *    call LT_BuildA() to turn these specifications into a window.
  2511. *
  2512. *   INPUTS
  2513. *    Handle - Pointer to LayoutHandle structure.
  2514. *
  2515. *
  2516. *    This routine will accept almost all create-time tag items
  2517. *    gadtools.library/CreateGadget will handle. In addition to
  2518. *    this there are a bunch of extra gadget objects and extra
  2519. *    tag items supported:
  2520. *
  2521. *    All object types:
  2522. *
  2523. *        LA_Type (LONG) - Type of the object to create, must be
  2524. *            one of the following:
  2525. *
  2526. *                TEXT_KIND
  2527. *                VERTICAL_KIND
  2528. *                HORIZONTAL_KIND
  2529. *                END_KIND
  2530. *                FRAME_KIND
  2531. *                BOX_KIND
  2532. *                SLIDER_KIND
  2533. *                LISTVIEW_KIND
  2534. *                INTEGER_KIND
  2535. *                STRING_KIND
  2536. *                PASSWORD_KIND
  2537. *                PALETTE_KIND
  2538. *                BUTTON_KIND
  2539. *                CHECKBOX_KIND
  2540. *                NUMBER_KIND
  2541. *                GAUGE_KIND
  2542. *                CYCLE_KIND
  2543. *                POPUP_KIND
  2544. *                TAB_KIND
  2545. *                MX_KIND
  2546. *                XBAR_KIND
  2547. *                YBAR_KIND
  2548. *                TAPEDECK_KIND
  2549. *                LEVEL_KIND
  2550. *                BOOPSI_KIND
  2551. *                BLANK_KIND (V36)
  2552. *                FRACTION_KIND (V38)
  2553. *                IMAGE_KIND (V41)
  2554. *                TEXTEDIT_KIND (V46)
  2555. *
  2556. *        LA_LabelText (STRPTR) - The object label text to use.
  2557. *
  2558. *        LA_LabelID (LONG) - The locale text ID of the string to
  2559. *            use as the object label text.
  2560. *
  2561. *                NOTE: LT_NewA() will fail if you forget
  2562. *                    to select a hook with LAHN_LocaleHook
  2563. *                    at LT_CreateHandleTagList.
  2564. *
  2565. *        LA_ID (LONG) - The gadget ID to use for this object.
  2566. *
  2567. *                NOTE: User ID values *MUST* be greater than 0,
  2568. *                      negative values are reserved for internal
  2569. *                      use.
  2570. *
  2571. *        LA_Chars (LONG) - The width of this object measured in
  2572. *            characters. If each character of the user interface
  2573. *            font is 8 pixels wide an object with LA_Chars set to
  2574. *            10 will usually be 80 pixels wide.
  2575. *
  2576. *        LA_LabelChars (LONG) - This forces the internal gadget
  2577. *            label width the layout engine calculates during the
  2578. *            layout pass to a specific value. Note: this does
  2579. *            not work well with all objects. (V9)
  2580. *
  2581. *        LA_LabelPlace (LONG) - Where to place the gadget label.
  2582. *            Not all objects will support all label positions:
  2583. *
  2584. *                PLACE_LEFT - Place label text left of object
  2585. *                PLACE_RIGHT - Place label text right of object
  2586. *                PLACE_ABOVE - Place label text above object
  2587. *                PLACE_IN - Place label text in object
  2588. *                PLACE_BELOW - Place label text below object
  2589. *
  2590. *        LA_ExtraSpace (BOOL) - Add extra vertical/horizontal
  2591. *            space before this object.
  2592. *            Default: FALSE
  2593. *
  2594. *        LA_ExtraFat (BOOL) - Make this object a bit larger
  2595. *            than its usual size.
  2596. *            Default: FALSE
  2597. *
  2598. *        LA_NoKey (BOOL) - Don't let the user interface choose
  2599. *            a keyboard shortcut for this object.
  2600. *            Default: FALSE
  2601. *
  2602. *        LA_HighLabel (BOOL) - Use highlight pen when rendering
  2603. *            the gadget label text.
  2604. *            Default: FALSE
  2605. *
  2606. *        LA_BYTE (BYTE *) - Pointer to the variable that holds
  2607. *            the "current value" of the object. The layout engine
  2608. *            will retrieve this value initially during the creation
  2609. *            of the object and maintain it during its lifespan.
  2610. *            This means you do not need to worry about checking
  2611. *            the state of the object, the user interface layout
  2612. *            engine will do it for you.
  2613. *
  2614. *        LA_UBYTE (UBYTE *) - Pointer to the variable that holds
  2615. *            the "current value" of the object. The layout engine
  2616. *            will retrieve this value initially during the creation
  2617. *            of the object and maintain it during its lifespan.
  2618. *            This means you do not need to worry about checking
  2619. *            the state of the object, the user interface layout
  2620. *            engine will do it for you.
  2621. *
  2622. *        LA_WORD (WORD *) - Pointer to the variable that holds
  2623. *            the "current value" of the object. The layout engine
  2624. *            will retrieve this value initially during the creation
  2625. *            of the object and maintain it during its lifespan.
  2626. *            This means you do not need to worry about checking
  2627. *            the state of the object, the user interface layout
  2628. *            engine will do it for you.
  2629. *
  2630. *        LA_UWORD (UWORD *) - Pointer to the variable that holds
  2631. *            the "current value" of the object. The layout engine
  2632. *            will retrieve this value initially during the creation
  2633. *            of the object and maintain it during its lifespan.
  2634. *            This means you do not need to worry about checking
  2635. *            the state of the object, the user interface layout
  2636. *            engine will do it for you.
  2637. *
  2638. *        LA_BOOL (BOOL *) - Pointer to the variable that holds
  2639. *            the "current value" of the object. The layout engine
  2640. *            will retrieve this value initially during the creation
  2641. *            of the object and maintain it during its lifespan.
  2642. *            This means you do not need to worry about checking
  2643. *            the state of the object, the user interface layout
  2644. *            engine will do it for you.
  2645. *
  2646. *        LA_LONG (LONG *) - Pointer to the variable that holds
  2647. *            the "current value" of the object. The layout engine
  2648. *            will retrieve this value initially during the creation
  2649. *            of the object and maintain it during its lifespan.
  2650. *            This means you do not need to worry about checking
  2651. *            the state of the object, the user interface layout
  2652. *            engine will do it for you.
  2653. *
  2654. *        LA_ULONG (ULONG *) - Pointer to the variable that holds
  2655. *            the "current value" of the object. The layout engine
  2656. *            will retrieve this value initially during the creation
  2657. *            of the object and maintain it during its lifespan.
  2658. *            This means you do not need to worry about checking
  2659. *            the state of the object, the user interface layout
  2660. *            engine will do it for you.
  2661. *
  2662. *        LA_STRPTR (STRPTR) - Pointer to the variable that holds
  2663. *            the "current value" of the object. The layout engine
  2664. *            will retrieve this value initially during the creation
  2665. *            of the object and maintain it during its lifespan.
  2666. *            This means you do not need to worry about checking
  2667. *            the state of the object, the user interface layout
  2668. *            engine will do it for you.
  2669. *
  2670. *        LA_FRACTION (FRACTION *) - Pointer to the variable that holds
  2671. *            the "current value" of the object. The layout engine
  2672. *            will retrieve this value initially during the creation
  2673. *            of the object and maintain it during its lifespan.
  2674. *            This means you do not need to worry about checking
  2675. *            the state of the object, the user interface layout
  2676. *            engine will do it for you.
  2677. *
  2678. *
  2679. *        BLANK_KIND (transparent placeholder):
  2680. *
  2681. *            (requires gtlayout.library V36 or higher)
  2682. *
  2683. *            No tags are defined for this type of object.
  2684. *
  2685. *
  2686. *        BOOPSI_KIND:
  2687. *
  2688. *            (requires gtlayout.library V10 or higher)
  2689. *
  2690. *            LABO_TagCurrent (Tag) - The Tag ID that represents the
  2691. *                current object value. For PROPGCLASS this would be
  2692. *                PGA_Top.
  2693. *
  2694. *            LABO_TagTextAttr (Tag) - The Tag ID that represents the
  2695. *                TextAttr value the object expects. For gadgets this
  2696. *                would be GA_TextAttr.
  2697. *
  2698. *            LABO_TagDrawInfo (Tag) - The Tag ID that represents the
  2699. *                DrawInfo value the object expects.
  2700. *
  2701. *            LABO_TagLink (Tag) - The Tag ID that represents a pointer
  2702. *                to a different object the object expects. For the
  2703. *                colorwheel.gadget this would be WHEEL_GradientSlider.
  2704. *
  2705. *            LABO_TagScreen (Tag) - The Tag ID that represents the
  2706. *                screen the object expects. For the colorwheel.gadget
  2707. *                this would be WHEEL_Screen.
  2708. *
  2709. *            LABO_Link (LONG) - The ID of the object this object should
  2710. *                be linked to. This will be resolved later when gadgets
  2711. *                are created.
  2712. *
  2713. *                    NOTE: Forward references are not resolved, only
  2714. *                        backward references are allowed. This means that
  2715. *                        if you wish to link object A to object B,
  2716. *                        object A must be created before object B
  2717. *                        is created.
  2718. *
  2719. *            LABO_ClassInstance (Class *) - This is the first parameter
  2720. *                you would pass to NewObjectA().
  2721. *
  2722. *                    NOTE: Only classes derived from gadgetclass and
  2723. *                      gadgetclass itself may be used.
  2724. *
  2725. *            LABO_ClassName (STRPTR) - This is the second parameter you would
  2726. *                pass to NewObject().
  2727. *
  2728. *                    NOTE: Only classes derived from gadgetclass and
  2729. *                        gadgetclass itself may be used.
  2730. *
  2731. *            LABO_ClassLibraryName (STRPTR) - This tag is particularly useful
  2732. *                for gadget class implementations wrapped into libraries, such as
  2733. *                colorwheel.gadget. When opened, they make the classes they
  2734. *                represent publicly available so subsequent calls to
  2735. *                NewObject(NULL,<Classname>,...) can be made. The
  2736. *                LABO_ClassLibraryName tag will cause gtlayout.library to open
  2737. *                the class library before any calls to NewObject() are made.
  2738. *
  2739. *                    NOTE: Only classes derived from gadgetclass and
  2740. *                        gadgetclass itself may be used.
  2741. *
  2742. *                        The LABO_ClassLibraryName tag requires that you
  2743. *                        specify the class name with the LABO_ClassName. It is
  2744. *                        not enough to just use the LABO_ClassLibraryName tag.
  2745. *
  2746. *            LABO_ExactWidth (WORD) - This is the exact width of the object to
  2747. *                use. This effectively overrides whatever you specified using
  2748. *                the LA_Chars tag and keeps gtlayout.library from shrinking and
  2749. *                expanding the object as needed.
  2750. *
  2751. *            LABO_ExactHeight (WORD) - This is the exact height of the object to
  2752. *                use. This effectively overrides whatever you specified using
  2753. *                the LA_Lines tag and keeps gtlayout.library from shrinking and
  2754. *                expanding the object as needed.
  2755. *
  2756. *            LABO_RelFontHeight (WORD) - This tag affects the height of the
  2757. *                object; when specified, it is derived from the user interface
  2758. *                font height plus the value given with LABO_RelFontHeight.
  2759. *
  2760. *            LABO_FullWidth (BOOL) - Use this tag if you wish the object to
  2761. *                cover the entire width of the group it resides within.
  2762. *
  2763. *            LABO_FullHeight (BOOL) - Use this tag if you wish the object to
  2764. *                cover the entire height of the group it resides within.
  2765. *
  2766. *            LABO_ActivateHook (struct Hook *) - Hook to invoke when the
  2767. *                layout engine decides that this particular object should
  2768. *                be activated. The hook is called with the following
  2769. *                parameters:
  2770. *
  2771. *                Success = ActivateFunc(struct Hook *Hook,LayoutHandle *Handle,
  2772. *                  D0                                 A0                  A2
  2773. *
  2774. *                             Object *object)
  2775. *                                       A1
  2776. *
  2777. *                The object pointer actually refers to the instance of the
  2778. *                BOOPSI object created. Return FALSE if your object could not
  2779. *                be activated, TRUE if it worked. If you return TRUE, no special
  2780. *                keyboard event will be generated. (V13)
  2781. *
  2782. *            NOTE: All tags passed to LT_New() for BOOPSI_KIND objects are
  2783. *                passed through to NewObjectA() later. The library makes
  2784. *                a copy of the tag item list, so all data valid in the
  2785. *                scope when LT_New() is called must also be valid later
  2786. *                when LT_Build() is invoked.
  2787. *
  2788. *                The gadget label is *NOT* passed through to the object,
  2789. *                it effectively receives the label a plain gadtools object
  2790. *                would receive, similar to what happens to FRAME_KIND
  2791. *                objects and the like.
  2792. *
  2793. *
  2794. *        BOX_KIND (multiline text display):
  2795. *
  2796. *            LABX_Chars (LONG) - The width of this object in
  2797. *                characters. The layout routine will try to make
  2798. *                sure that the given number of characters will
  2799. *                fit into a single line of text in this box.
  2800. *                This may be a problem with proportional spaced
  2801. *                fonts.
  2802. *               Default: 10
  2803. *
  2804. *            LABX_Labels (STRPTR *) - The label texts to display
  2805. *                on the right hand side of the box. Terminate
  2806. *                this array with NULL.
  2807. *
  2808. *            LABX_Lines (STRPTR *) - The text to display in the
  2809. *                box. Terminate this array with NULL.
  2810. *
  2811. *            LABX_Rows (LONG) - The height of this object in
  2812. *                characters.
  2813. *
  2814. *            LABX_AlignText (LONG) - Controls how text is aligned
  2815. *                in box lines:
  2816. *
  2817. *                    ALIGNTEXT_LEFT - Align text to the left edge
  2818. *                    ALIGNTEXT_CENTERED - Centre the text
  2819. *                    ALIGNTEXT_RIGHT - Align text to the right edge
  2820. *                    ALIGNTEXT_PAD - Pad text lines
  2821. *
  2822. *                Default: ALIGNTEXT_LEFT
  2823. *
  2824. *            LABX_DrawBox (BOOL) - Draw a recessed bevel box
  2825. *                around the text box.
  2826. *                Default: FALSE
  2827. *
  2828. *            LABX_FirstLabel (LONG) - Locale string ID of the first
  2829. *                text to use as a box label. Works in conjunction
  2830. *                with LABX_LastLabel.
  2831. *
  2832. *            LABX_LastLabel (LONG) - Locale string ID of the last
  2833. *                text to use as a box label. Works in conjunction
  2834. *                with LABX_FirstLabel. When building the interface the
  2835. *                code will loop from FirstLabel..LastLabel, look
  2836. *                up the corresponding locale strings and use the
  2837. *                data to make up the label text to appear at the
  2838. *                right hand side of the box.
  2839. *
  2840. *            LABX_LabelTable (LONG *) - Pointer to an array of IDs
  2841. *                to use for building the box labels. This requires
  2842. *                that a locale hook is provided with the layout handle.
  2843. *                The array is terminated by -1.
  2844. *
  2845. *            LABX_ReserveSpace (BOOL) - Allocate extra memory to hold
  2846. *                the contents of the lines displayed. This avoids nasty
  2847. *                side-effects when refreshing this object.
  2848. *                Default: FALSE
  2849. *
  2850. *            LABX_FirstLine (LONG) - Locale string ID of the first
  2851. *                text to print inside the box. Works in conjunction
  2852. *                with LABX_LastLine. (V26)
  2853. *
  2854. *            LABX_LastLine (LONG) - Locale string ID of the last
  2855. *                text to print inside the box. Works in conjunction
  2856. *                with LABX_FirstLine. (V26)
  2857. *
  2858. *            LABX_LineTable (LONG *) - Pointer to an array of IDs
  2859. *                to use for building the box contents lines. This requires
  2860. *                that a locale hook is provided with the layout handle.
  2861. *                The array is terminated by -1. (V28)
  2862. *
  2863. *            LABX_Line (STRPTR) - Line to display in the box, may
  2864. *                contain '\n' line break characters, the layout engine
  2865. *                will chop the single line into single consecutive lines
  2866. *                following the '\n' chars. (V31)
  2867. *
  2868. *            LABX_LineID (LONG) - Locale ID of line text to display in the
  2869. *                box, may contain '\n' line break characters, the layout
  2870. *                engine will chop the single line into single consecutive lines
  2871. *                following the '\n' chars. (V31)
  2872. *
  2873. *            LABX_TextPen (WORD) - Box text colour to use. (V40)
  2874. *
  2875. *            LABX_BackPen (WORD) - Box text background colour to use. (V40)
  2876. *
  2877. *            LABX_Spacing (UWORD) - Request that additional pixels should
  2878. *                separate lines of text. (V41)
  2879. *                Default: 0
  2880. *
  2881. *
  2882. *        BUTTON_KIND:
  2883. *
  2884. *            LA_Label (STRPTR)
  2885. *            LA_LabelID (LONG) - These two define the button label, i.e.
  2886. *                the text that is printed within the button box. Optionally,
  2887. *                this text may include newline characters ("\n") which will
  2888. *                cause the button text to be broken into several lines.
  2889. *                This particular feature requires gtlayout.library v12 or
  2890. *                higher. Single line label have always been supported.
  2891. *
  2892. *            LABT_ReturnKey (BOOL) - Let the user operate this
  2893. *                button by pressing the return key, making it the
  2894. *                so-called default button, or default choice. The
  2895. *                button select box will appear slightly bolder than
  2896. *                normal buttons are.
  2897. *
  2898. *                    NOTE: there can be only one single button per
  2899. *                        window to sport this feature.
  2900. *
  2901. *                Default: FALSE
  2902. *
  2903. *            LABT_EscKey (BOOL) - Let the user operate this
  2904. *                button by pressing the Escape key.
  2905. *
  2906. *                    NOTE: there can be only one single button per
  2907. *                        window to use this feature.
  2908. *
  2909. *                Default: FALSE
  2910. *
  2911. *            LABT_ExtraFat (BOOL) - Make this button a bit
  2912. *                larger than usual.
  2913. *                Default: FALSE
  2914. *
  2915. *            LABT_Lines (STRPTR *) - Use the given string array
  2916. *                to create a multiline gadget label. Terminate the
  2917. *                array with a NULL. (V12)
  2918. *
  2919. *            LABT_FirstLine (LONG) - Locale ID of first label line. (V12)
  2920. *
  2921. *            LABT_LastLine (LONG) - Locale ID of last label line. (V12)
  2922. *
  2923. *            LABT_DefaultCorrection (BOOL) - Make the button slightly
  2924. *                wider and taller so its size matches the default
  2925. *                button. (V21)
  2926. *
  2927. *            LABT_Smaller (BOOL) - Make this button a little smaller
  2928. *                than usual. (V21)
  2929. *
  2930. *
  2931. *        CYCLE_KIND:
  2932. *
  2933. *            LACY_FirstLabel (LONG) - Locale string ID of the first
  2934. *                text to use as a label. Works in conjunction
  2935. *                with LACY_LastLabel.
  2936. *
  2937. *            LACY_LastLabel (LONG) - Locale string ID of the last
  2938. *                text to use as a label. Works in conjunction
  2939. *                with LACY_FirstLabel. When building the interface the
  2940. *                code will loop from FirstLabel..LastLabel, look
  2941. *                up the corresponding locale strings and use the
  2942. *                data to make up the label text.
  2943. *
  2944. *            LACY_LabelTable (LONG *) - Pointer to an array of IDs
  2945. *                to use for building the cycle labels. This requires
  2946. *                that a locale hook is provided with the layout handle.
  2947. *                The array is terminated by -1.
  2948. *
  2949. *            LACY_TabKey (BOOL) - Connect this object to the tabulator
  2950. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  2951. *                to cycle to the previous entry. (V9)
  2952. *
  2953. *                    NOTE: there can be only one single button per
  2954. *                        window to use this feature.
  2955. *
  2956. *                Default: FALSE
  2957. *
  2958. *            LACY_AutoPageID (LONG) - ID of paged GROUP_KIND object
  2959. *                which will be set to the gadget's current setting.
  2960. *                If this tag is set, you will hear no events from this
  2961. *                object any more. (V7)
  2962. *
  2963. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  2964. *                        which may be generated if the layout
  2965. *                        engine runs out of memory when rebuilding
  2966. *                        the user interface.
  2967. *
  2968. *
  2969. *        FRACTION_KIND:
  2970. *
  2971. *            (requires gtlayout.library V38 or higher)
  2972. *
  2973. *            This is a special kind of STRING_KIND which comes with a
  2974. *            special input filter. It will allow only for floating point
  2975. *            numbers to be entered, i.e. numbers (`0'-`9') and one
  2976. *            decimal point (`.' or whatever your current locale uses
  2977. *            as the decimal point character). What you will receive as
  2978. *            user input text will be in the following format:
  2979. *
  2980. *                (0|#[0-9]).(0|#[0-9])
  2981. *
  2982. *            Or in other words, text like this will be returned:
  2983. *
  2984. *                0.0
  2985. *                7.0
  2986. *                0.9
  2987. *                146654.0
  2988. *
  2989. *            NOTE: While this object type did exist in earlier library
  2990. *                  versions support for it was removed in V33. It was
  2991. *                  eventually reintroduced with the functionality described
  2992. *                  above in V38.
  2993. *
  2994. *            LAFR_IncrementerHook (struct Hook *) - Hook to invoke when the
  2995. *                incrementer arrows are used. The hook function will receive
  2996. *                three parameters and has to return a result code:
  2997. *
  2998. *                    a0 - (struct Hook *)  Pointer to this hook
  2999. *                    a2 - (STRPTR) Current value of this object
  3000. *                    a1 - (LONG) Either INCREMENTERMSG_Decrement or
  3001. *                                INCREMENTERMSG_Increment
  3002. *
  3003. *                If the hook function modifies the current value it must
  3004. *                return TRUE, otherwise FALSE must be returned. If you return
  3005. *                TRUE, then the library will update the object. (V40)
  3006. *
  3007. *            This object type accepts all the GTST_#? tag items.
  3008. *
  3009. *
  3010. *        FRAME_KIND (fixed size general purpose display,
  3011. *            you may render into it):
  3012. *
  3013. *            LAFR_InnerWidth (LONG) - Inner width of the
  3014. *                display box.
  3015. *
  3016. *            LAFR_InnerHeight (LONG) - Inner height of the
  3017. *                display box.
  3018. *
  3019. *            LAFR_DrawBox (BOOL) - Draw a recessed bevel box
  3020. *                around the display box.
  3021. *                Default: FALSE
  3022. *
  3023. *            LAFR_RefreshHook (struct Hook *) - Hook to call
  3024. *                when refreshing/redrawing this object. See
  3025. *                gtlayout.h for more information. (V9)
  3026. *
  3027. *            LAFR_GenerateEvents (BOOL) - If TRUE, clicking
  3028. *                inside the FRAME_KIND object will generate
  3029. *                IDCMP_GADGETUP/IDCMP_GADGETDOWN events. If
  3030. *                you wish to know where the click occured,
  3031. *                make a copy of the Window->MouseX/Y entries
  3032. *                before you call LT_HandleInput()/LT_GetIMsg(). (V28)
  3033. *                Default: FALSE
  3034. *
  3035. *            LAFR_ResizeX (BOOL) - Makes this frame resizable
  3036. *                in the horizontal direction, attaches a sizing
  3037. *                gadget to the window to open and handles window
  3038. *                resize operations automatically. (V44)
  3039. *
  3040. *                    NOTE: there can be only one single object
  3041. *                        per window to sport this feature. This
  3042. *                        means that you won't be able to have
  3043. *                        both a resizable listview and a resizable
  3044. *                        frame in the same window.
  3045. *
  3046. *                        Also listen to IDCMP_CLOSEWINDOW events
  3047. *                        which may be generated if the layout
  3048. *                        engine runs out of memory when rebuilding
  3049. *                        the user interface.
  3050. *
  3051. *                Default: FALSE
  3052. *
  3053. *            LAFR_ResizeY (BOOL) - Makes this frame resizable
  3054. *                in the vertical direction, attaches a sizing
  3055. *                gadget to the window to open and handles window
  3056. *                resize operations automatically. (V44)
  3057. *
  3058. *                    NOTE: there can be only one single object
  3059. *                        per window to sport this feature. This
  3060. *                        means that you won't be able to have
  3061. *                        both a resizable listview and a resizable
  3062. *                        frame in the same window.
  3063. *
  3064. *                        Also listen to IDCMP_CLOSEWINDOW events
  3065. *                        which may be generated if the layout
  3066. *                        engine runs out of memory when rebuilding
  3067. *                        the user interface.
  3068. *
  3069. *                Default: FALSE
  3070. *
  3071. *        GAUGE_KIND (general purpose progress report display):
  3072. *
  3073. *            LAGA_Percent (LONG) - Indicator position, can range
  3074. *                from 0..100.
  3075. *                Default: 0
  3076. *
  3077. *            LAGA_InfoLength (LONG) - Maximum number of characters
  3078. *                to reserve for text printed in the gauge display.
  3079. *                Default: 0
  3080. *
  3081. *            LAGA_InfoText (STRPTR) - Text to print in the gauge
  3082. *                display.
  3083. *
  3084. *            LAGA_Tenth (BOOL) - Instead of a continuously growing
  3085. *                bar you will get a set of exactly ten blocks,
  3086. *                each separated by a hairline. (V19)
  3087. *                Default: FALSE
  3088. *
  3089. *               LAGA_NoTicks (BOOL) - If TRUE suppresses drawing the
  3090. *                   ticks below the gauge box.
  3091. *                   Default: FALSE
  3092. *
  3093. *
  3094. *        IMAGE_KIND (display area for Image or BitMap data):
  3095. *
  3096. *            (requires gtlayout.library V41 or higher)
  3097. *
  3098. *            LAIM_Image (struct Image *) - Image to draw in this
  3099. *                place. When the user interface is built, it will
  3100. *                be drawn using intuition.library/DrawImage().
  3101. *
  3102. *            LAIM_BitMap (struct BitMap *) - You can supply a
  3103. *                BitMap instead of an Image which will be drawn
  3104. *                using either graphics.library/BltBitMapRastPort()
  3105. *                or graphics.library/BltMaskBitMapRastPort() if
  3106. *                a mask is provided.
  3107. *
  3108. *            LAIM_BitMapLeft (UWORD) - Left corner of the image data
  3109. *                to blit into the window (the second parameter for
  3110. *                BltBitMapRastPort()).
  3111. *
  3112. *            LAIM_BitMapTop (UWORD) - Top corner of the image data
  3113. *                to blit into the window (the third parameter for
  3114. *                BltBitMapRastPort()).
  3115. *
  3116. *            LAIM_BitMapWidth (UWORD) - Width of the bitmap area to
  3117. *                blit into the window.
  3118. *
  3119. *            LAIM_BitMapHeight (UWORD) - Height of the bitmap area to
  3120. *                blit into the window.
  3121. *
  3122. *            LAIM_BitMapMask (PLANEPTR) - Pointer to a bit plane mask
  3123. *                to blit the image bitmap through. Must follow the
  3124. *                rules documented for for BltMaskBitMapRastPort().
  3125. *                The blit operation will use the minterm for
  3126. *                transparency.
  3127. *
  3128. *
  3129. *        INTEGER_KIND:
  3130. *
  3131. *            LAIN_LastGadget (BOOL) - Pressing return with this
  3132. *                gadget active will stop activating the next
  3133. *                following string gadget type if TRUE is passed.
  3134. *                Default: FALSE
  3135. *
  3136. *            LAIN_Min (LONG) - Minimum accepted numeric value.
  3137. *                Default: -2147483647
  3138. *
  3139. *            LAIN_Max (LONG) - Maximum accepted numeric value.
  3140. *                Default:  2147483647
  3141. *
  3142. *            LAIN_UseIncrementers (BOOL) - Use TRUE to add incrementer
  3143. *                arrow buttons to the right of the numeric entry field.
  3144. *                These buttons will let you cycle through a set of
  3145. *                numbers to be displayed in the numeric entry field.
  3146. *                Default: FALSE
  3147. *
  3148. *            LAIN_HistoryLines (LONG) - Number of numbers entered to
  3149. *                keep as a backlog.
  3150. *                Default: 0
  3151. *
  3152. *            LAIN_HistoryHook (struct Hook *) - Hook code to call when
  3153. *                entering a number into the backlog. See gtlayout.h for
  3154. *                more information.
  3155. *                Default: NULL
  3156. *
  3157. *            LAIN_IncrementerHook (struct Hook *) - Hook code to call
  3158. *                when cycling through numeric values. See gtlayout.h for
  3159. *                more information.
  3160. *                Default: NULL
  3161. *
  3162. *            LAIN_Activate (BOOL) - When the window opens, make this
  3163. *                gadget the active one. (V21)
  3164. *
  3165. *                    NOTE: There can be only one gadget of this type
  3166. *                        per window.
  3167. *
  3168. *                Default: FALSE
  3169. *
  3170. *
  3171. *        LEVEL_KIND:
  3172. *
  3173. *            All tags are supported which SLIDER_KIND supports.
  3174. *            The gadget level display however, can only be aligned
  3175. *            to the left border.
  3176. *
  3177. *            LAVL_Freedom (WORD) - Selects the orientation of the
  3178. *                slider body; can be either FREEHORIZ or FREEVERT. (V41)
  3179. *
  3180. *                Default: FREEHORIZ
  3181. *
  3182. *            LAVL_Ticks (WORD) - Selects if and where to place tick
  3183. *                marks next to the slider body. Can be one of the
  3184. *                the following: TICKS_None (no ticks), TICKS_Left
  3185. *                (place ticks left of the body), TICKS_Above (place
  3186. *                ticks above the body), TICKS_Both (place ticks on
  3187. *                both sides of the body). (V41)
  3188. *
  3189. *                Default: TICKS_None
  3190. *
  3191. *            LAVL_NumTicks (LONG) - Number of tick marks to draw. (V41)
  3192. *
  3193. *            LAVL_Lines (LONG) - Height of the slider, if FREEVERT. (V41)
  3194. *
  3195. *
  3196. *        LISTVIEW_KIND:
  3197. *
  3198. *            LALV_ExtraLabels (STRPTR *) - Place extra line
  3199. *                labels at the right of the box. Terminate
  3200. *                this array with NULL.
  3201. *
  3202. *            LALV_Labels (STRPTR *) - The labels to display
  3203. *                inside the box, you can pass this array of
  3204. *                strings in rather than passing an initialized
  3205. *                List of text via GTLV_Labels. Terminate
  3206. *                this array with NULL.
  3207. *
  3208. *            LALV_CursorKey (BOOL) - Let the user operate this
  3209. *                listview using the cursor keys.
  3210. *
  3211. *                    NOTE: there can be only one single listview
  3212. *                        per window to sport this feature.
  3213. *
  3214. *                Default: FALSE
  3215. *
  3216. *            LALV_Lines (LONG) - The number of text lines this
  3217. *                listview is to display.
  3218. *
  3219. *            LALV_Link (LONG) - The Gadget ID of a string gadget
  3220. *                to attach to this listview.
  3221. *
  3222. *                    NOTE: you need to
  3223. *                        add the Gadget in question before you add the
  3224. *                        listview to refer to it or the layout routine
  3225. *                        will get confused.
  3226. *
  3227. *                Passing the value NIL_LINK will create a listview
  3228. *                which displays the currently selected item, otherwise
  3229. *                you will get a read-only list.
  3230. *
  3231. *            LALV_FirstLabel (LONG) - Locale string ID of the first
  3232. *                text to use as a list label. Works in conjunction
  3233. *                with LALV_LastLabel.
  3234. *
  3235. *            LALV_LastLabel (LONG) - Locale string ID of the last
  3236. *                text to use as a list label. Works in conjunction
  3237. *                with LALV_FirstLabel. When building the interface the
  3238. *                code will loop from FirstLabel..LastLabel, look
  3239. *                up the corresponding locale strings and use the
  3240. *                data to make up the label text to appear in the
  3241. *                list.
  3242. *
  3243. *            LALV_LabelTable (LONG *) - Pointer to an array of IDs
  3244. *                to use for building the listview contents. This requires
  3245. *                that a locale hook is provided with the layout handle.
  3246. *                The array is terminated by -1.
  3247. *
  3248. *            LALV_MaxGrowX (LONG) - Maximum width of this object
  3249. *                measured in characters. When the first layout pass
  3250. *                is finished and there is still enough space left
  3251. *                to make the listview wider, the width is increased
  3252. *                until it hits the limit specified using this tag.
  3253. *
  3254. *                    NOTE: there can be only one single listview
  3255. *                        per window to sport this feature.
  3256. *
  3257. *                Default: 0
  3258. *
  3259. *            LALV_MaxGrowY (LONG) - Maximum height of this object
  3260. *                measured in lines. When the first layout pass is
  3261. *                finished and there is still enough space left to
  3262. *                make the listview higher, the height is increased
  3263. *                until it hits the limit specified using this tag.
  3264. *
  3265. *                    NOTE: there can be only one single listview
  3266. *                        per window to sport this feature.
  3267. *
  3268. *                Default: 0
  3269. *
  3270. *            LALV_ResizeX (BOOL) - Makes this listview resizable
  3271. *                in the horizontal direction, attaches a sizing
  3272. *                gadget to the window to open and handles window
  3273. *                resize operations automatically. (V9)
  3274. *
  3275. *                    NOTE: there can be only one single object
  3276. *                        per window to sport this feature. This
  3277. *                        means that you won't be able to have
  3278. *                        both a resizable listview and a resizable
  3279. *                        frame in the same window.
  3280. *
  3281. *                        Also listen to IDCMP_CLOSEWINDOW events
  3282. *                        which may be generated if the layout
  3283. *                        engine runs out of memory when rebuilding
  3284. *                        the user interface.
  3285. *
  3286. *                Default: FALSE
  3287. *
  3288. *            LALV_ResizeY (BOOL) - Makes this listview resizable
  3289. *                in the vertical direction, attaches a sizing
  3290. *                gadget to the window to open and handles window
  3291. *                resize operations automatically. (V9)
  3292. *
  3293. *                    NOTE: there can be only one single object
  3294. *                        per window to sport this feature. This
  3295. *                        means that you won't be able to have
  3296. *                        both a resizable listview and a resizable
  3297. *                        frame in the same window.
  3298. *
  3299. *                        Also listen to IDCMP_CLOSEWINDOW events
  3300. *                        which may be generated if the layout
  3301. *                        engine runs out of memory when rebuilding
  3302. *                        the user interface.
  3303. *
  3304. *                Default: FALSE
  3305. *
  3306. *            LALV_MinChars (WORD) - Minimum width for this
  3307. *                object, measured in characters. Used in
  3308. *                conjunction with LALV_ResizeX. (V9)
  3309. *
  3310. *            LALV_MinLines (WORD) - Minimum height for this
  3311. *                object, measured in lines. Used in
  3312. *                conjunction with LALV_ResizeY. (V9)
  3313. *
  3314. *            LALV_LockSize (BOOL) - After doing the initial layout
  3315. *                for this object, do not adapt its size again during
  3316. *                subsequent layouts. This is particularly useful if
  3317. *                you have a LISTVIEW_KIND object in a paged group
  3318. *                and keep adding new entries to the list. You need
  3319. *                to specify an object width using LA_Chars, otherwise
  3320. *                the layout engine may make it not wide enough to
  3321. *                display any entries. (V8)
  3322. *
  3323. *            LALV_FlushLabelLeft (BOOL) - For a gadget label placed
  3324. *                above the listview align the text to the left edge
  3325. *                of the view. (V9)
  3326. *
  3327. *            LALV_TextAttr (struct TextAttr *) - You can specify a
  3328. *                fixed-width font to be used for the list display.
  3329. *                The TextAttr (or TTextAttr) you provide must be ready
  3330. *                to go so the layout code can open the font later.
  3331. *
  3332. *                To get the current system default font, which is
  3333. *                guaranteed to be fixed-width, pass ~0 instead of a
  3334. *                pointer to a TextAttr structure. (V10)
  3335. *
  3336. *                    NOTE: The font *MUST* be fixed-width or the layout
  3337. *                        will fail.
  3338. *
  3339. *                         Choose your font in such a way that it matches
  3340. *                         in width and height with the other probably
  3341. *                         proportional-spaced user interface font.
  3342. *
  3343. *                         If the layout engine decides to step down in
  3344. *                         font size, all LISTVIEW_KIND objects which were
  3345. *                         configured to use a special fixed-width font
  3346. *                         will `forget' about it. This won't matter much
  3347. *                         as the fonts the engine chooses will always be
  3348. *                         fixed-width anyway.
  3349. *
  3350. *            LALV_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3351. *                which will be set to the gadget's current setting.
  3352. *                If this tag is set, you will hear no events from this
  3353. *                object any more. (V23)
  3354. *
  3355. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3356. *                        which may be generated if the layout
  3357. *                        engine runs out of memory when rebuilding
  3358. *                        the user interface.
  3359. *
  3360. *            LALV_Selected (LONG) - In this context, this tag is an
  3361. *                alias for GTLV_Selected. See
  3362. *                gtlayout.library/LT_SetAttributes for more information
  3363. *                on how the meaning of this tag differs from this (V34).
  3364. *
  3365. *
  3366. *        MX_KIND:
  3367. *
  3368. *            LAMX_FirstLabel (LONG) - Locale string ID of the first
  3369. *                text to use as a label. Works in conjunction
  3370. *                with LAMX_LastLabel.
  3371. *
  3372. *            LAMX_LastLabel (LONG) - Locale string ID of the last
  3373. *                text to use as a label. Works in conjunction
  3374. *                with LAMX_FirstLabel. When building the interface the
  3375. *                code will loop from FirstLabel..LastLabel, look
  3376. *                up the corresponding locale strings and use the
  3377. *                data to make up the label text.
  3378. *
  3379. *            LAMX_LabelTable (LONG *) - Pointer to an array of IDs
  3380. *                to use for building the radio labels. This requires
  3381. *                that a locale hook is provided with the layout handle.
  3382. *                The array is terminated by -1.
  3383. *
  3384. *            LAMX_TabKey (BOOL) - Connect this object to the tabulator
  3385. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3386. *                to cycle to the previous entry. (V9)
  3387. *
  3388. *                    NOTE: there can be only one single button per
  3389. *                        window to use this feature.
  3390. *
  3391. *                Default: FALSE
  3392. *
  3393. *            LAMX_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3394. *                which will be set to the gadget's current setting.
  3395. *                If this tag is set, you will hear no events from this
  3396. *                object any more. (V7)
  3397. *
  3398. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3399. *                        which may be generated if the layout
  3400. *                        engine runs out of memory when rebuilding
  3401. *                        the user interface.
  3402. *
  3403. *
  3404. *        PALETTE_KIND:
  3405. *
  3406. *            LAPA_SmallPalette (BOOL) - Make the palette display
  3407. *                a bit smaller than usual.
  3408. *                Default: FALSE
  3409. *
  3410. *            LAPA_Lines (LONG) - Number of lines the palette
  3411. *                display should cover.
  3412. *                Default: No preference
  3413. *
  3414. *            LAPA_UsePicker (BOOL) - This tag effectively changes the
  3415. *                gadget type. Instead of a list of colours to pick from
  3416. *                the user will see a rectangle filled in the selected
  3417. *                colour with a picker button next to it. This gadget
  3418. *                will generate IDCMP_IDCMPUPDATE events when the picker
  3419. *                button is pressed. (V10)
  3420. *
  3421. *
  3422. *        PASSWORD_KIND (string gadget type which does not
  3423. *            display its contents):
  3424. *
  3425. *            LAPW_LastGadget (BOOL) - Pressing return with this
  3426. *                gadget active will stop activating the next
  3427. *                following string gadget type if TRUE is passed.
  3428. *                Default: FALSE
  3429. *
  3430. *            LAPW_HistoryLines (LONG) - Number of lines to keep as
  3431. *                a backlog.
  3432. *                Default: 0
  3433. *
  3434. *            LAPW_HistoryHook (struct Hook *) - Hook code to call
  3435. *                when entering a line into the backlog. See gtlayout.h
  3436. *                for more information.
  3437. *                Default: NULL
  3438. *
  3439. *            LAPW_Activate (BOOL) - When the window opens, make this
  3440. *                gadget the active one. (V21)
  3441. *
  3442. *                    NOTE: There can be only one gadget of this type
  3443. *                        per window.
  3444. *
  3445. *                Default: FALSE
  3446. *
  3447. *            This object type accepts all the GTST_#? tag items.
  3448. *
  3449. *
  3450. *        POPUP_KIND:
  3451. *
  3452. *            (This features requires gtlayout.library v22 or higher
  3453. *             and Kickstart 3.0 or higher).
  3454. *
  3455. *            LAPU_FirstLabel (LONG) - Locale string ID of the first
  3456. *                text to use as a label. Works in conjunction
  3457. *                with LAPU_LastLabel.
  3458. *
  3459. *            LAPU_LastLabel (LONG) - Locale string ID of the last
  3460. *                text to use as a label. Works in conjunction
  3461. *                with LAPU_FirstLabel. When building the interface the
  3462. *                code will loop from FirstLabel..LastLabel, look
  3463. *                up the corresponding locale strings and use the
  3464. *                data to make up the label text.
  3465. *
  3466. *            LAPU_LabelTable (LONG *) - Pointer to an array of IDs
  3467. *                to use for building the cycle labels. This requires
  3468. *                that a locale hook is provided with the layout handle.
  3469. *                The array is terminated by -1.
  3470. *
  3471. *            LAPU_TabKey (BOOL) - Connect this object to the tabulator
  3472. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3473. *                to cycle to the previous entry.
  3474. *
  3475. *                    NOTE: there can be only one single button per
  3476. *                        window to use this feature.
  3477. *
  3478. *                Default: FALSE
  3479. *
  3480. *            LAPU_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3481. *                which will be set to the gadget's current setting.
  3482. *                If this tag is set, you will hear no events from this
  3483. *                object any more.
  3484. *
  3485. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3486. *                        which may be generated if the layout
  3487. *                        engine runs out of memory when rebuilding
  3488. *                        the user interface.
  3489. *
  3490. *            LAPU_CentreActive (BOOL) - If TRUE, the popup menu will
  3491. *                appear with the currently active entry centred below
  3492. *                the mouse pointer. (V31)
  3493. *
  3494. *            LAPU_Labels (STRPTR *) - Pointer to NULL-terminated array
  3495. *                of strings that are the choices offered.
  3496. *
  3497. *
  3498. *        SCROLLER_KIND:
  3499. *
  3500. *            LASC_Thin (BOOL) - Make the scroller a bit thinner
  3501. *                than usual.
  3502. *                Default: FALSE
  3503. *
  3504. *            GA_RelVerify (BOOL) - Hear every IDCMP_GADGETUP
  3505. *                event from scroller.
  3506. *                Default: TRUE
  3507. *
  3508. *                        NOTE: This is different from what
  3509. *                         gadtools.library uses.
  3510. *
  3511. *            GA_Immediate (BOOL) - Hear every IDCMP_GADGETDOWN
  3512. *                event from scroller
  3513. *                Default: TRUE
  3514. *
  3515. *                        NOTE: This is different from what
  3516. *                         gadtools.library uses.
  3517. *
  3518. *
  3519. *        SLIDER_KIND:
  3520. *
  3521. *            LASL_FullCheck: TRUE will cause the code to rattle
  3522. *                through all possible slider settings, starting
  3523. *                from the minimum value, ending at the maximum value.
  3524. *                While this may be a good idea for a display
  3525. *                function to map slider levels to text strings
  3526. *                of varying length it might be a problem when
  3527. *                it comes to display a range of numbers from
  3528. *                1 to 40,000: the code will loop through
  3529. *                40,000 iterations trying to find the longest
  3530. *                string.
  3531. *
  3532. *                FALSE will cause the code to calculate the
  3533. *                longest level string based only on the
  3534. *                minimum and the maximum value to check.
  3535. *                While this is certainly a good a idea when
  3536. *                it comes to display a range of numbers from
  3537. *                1 to 40,000 as only two values will be
  3538. *                checked the code may fail to produce
  3539. *                accurate results for sliders using display
  3540. *                functions mapping slider levels to strings.
  3541. *
  3542. *                Default: TRUE
  3543. *
  3544. *
  3545. *        STRING_KIND:
  3546. *
  3547. *            LAST_LastGadget (BOOL) - Pressing return with this
  3548. *                gadget active will stop activating the next
  3549. *                following string gadget type if TRUE is passed.
  3550. *                Default: FALSE
  3551. *
  3552. *            LAST_Link (LONG) - Gadget ID of the listview to attach
  3553. *                this string gadget to.
  3554. *
  3555. *                    NOTE: you need to add the string gadget before
  3556. *                        you add the listview to refer to it or the
  3557. *                        layout routine will get confused.
  3558. *
  3559. *            LAST_Picker (BOOL) - Attach a `select' button to the
  3560. *                right hand side of the string gadget.
  3561. *                Default: FALSE
  3562. *
  3563. *            LAST_HistoryLines (LONG) - Number of lines to keep as
  3564. *                a backlog.
  3565. *                Default: 0
  3566. *
  3567. *            LAST_HistoryHook (struct Hook *) - Hook code to call
  3568. *                when entering a line into the backlog. See gtlayout.h
  3569. *                for more information.
  3570. *                Default: NULL
  3571. *
  3572. *            LAST_Activate (BOOL) - When the window opens, make this
  3573. *                gadget the active one. (V21)
  3574. *
  3575. *                    NOTE: There can be only one gadget of this type
  3576. *                        per window.
  3577. *
  3578. *                Default: FALSE
  3579. *
  3580. *
  3581. *        TAB_KIND:
  3582. *
  3583. *            (This features requires gtlayout.library v24 or higher)
  3584. *
  3585. *            LATB_FirstLabel (LONG) - Locale string ID of the first
  3586. *                text to use as a label. Works in conjunction
  3587. *                with LATB_LastLabel.
  3588. *
  3589. *            LATB_LastLabel (LONG) - Locale string ID of the last
  3590. *                text to use as a label. Works in conjunction
  3591. *                with LATB_FirstLabel. When building the interface the
  3592. *                code will loop from FirstLabel..LastLabel, look
  3593. *                up the corresponding locale strings and use the
  3594. *                data to make up the label text.
  3595. *
  3596. *            LATB_LabelTable (LONG *) - Pointer to an array of IDs
  3597. *                to use for building the cycle labels. This requires
  3598. *                that a locale hook is provided with the layout handle.
  3599. *                The array is terminated by -1.
  3600. *
  3601. *            LATB_TabKey (BOOL) - Connect this object to the tabulator
  3602. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3603. *                to cycle to the previous entry.
  3604. *
  3605. *                    NOTE: there can be only one single button per
  3606. *                        window to use this feature.
  3607. *
  3608. *                Default: FALSE
  3609. *
  3610. *            LATB_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3611. *                which will be set to the gadget's current setting.
  3612. *                If this tag is set, you will hear no events from this
  3613. *                object any more.
  3614. *
  3615. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3616. *                        which may be generated if the layout
  3617. *                        engine runs out of memory when rebuilding
  3618. *                        the user interface.
  3619. *
  3620. *            LATB_FullSize (BOOL) - By default a TAB_KIND object
  3621. *                covers the entire width of the group it sits in.
  3622. *                With LATB_FullSize set to true it will cover the
  3623. *                width of the entire Window.
  3624. *
  3625. *                Default: FALSE
  3626. *
  3627. *            LATB_Labels (STRPTR *) - Pointer to NULL-terminated array
  3628. *                of strings that are the choices offered.
  3629. *
  3630. *
  3631. *        TAPEDECK_KIND:
  3632. *
  3633. *            LATD_ButtonType (LONG) - Select the image to display
  3634. *                in the button, must be one of the following:
  3635. *
  3636. *                    TDBT_BACKWARD
  3637. *                        "<<" Symbol
  3638. *
  3639. *                    TDBT_FORWARD
  3640. *                        ">>" Symbol
  3641. *
  3642. *                    TDBT_PREVIOUS
  3643. *                        "|<" Symbol
  3644. *
  3645. *                    TDBT_NEXT
  3646. *                        ">|" Symbol
  3647. *
  3648. *                    TDBT_STOP
  3649. *                        Stop symbol (filled square)
  3650. *
  3651. *                    TDBT_PAUSE
  3652. *                        "||" pause symbol (broken square)
  3653. *
  3654. *                    TDBT_RECORD
  3655. *                        Record symbol (filled circle)
  3656. *
  3657. *                    TDBT_REWIND
  3658. *                        "<" symbol
  3659. *
  3660. *                    TDBT_EJECT
  3661. *                        Eject symbol (broken upward pointing arrow)
  3662. *
  3663. *                    TDBT_PLAY
  3664. *                        ">" symbol
  3665. *
  3666. *            LATD_Toggle (BOOL) - Make this object a toggle-select
  3667. *                button.
  3668. *                Default: FALSE
  3669. *
  3670. *            LATD_Pressed (BOOL) - Make this button appear to be
  3671. *                pressed.
  3672. *
  3673. *                    NOTE: requires "LATD_Toggle,TRUE" attribute.
  3674. *
  3675. *                Default: FALSE
  3676. *
  3677. *            LATD_Smaller (BOOL) - Make this button a bit smaller
  3678. *                than usual.
  3679. *                Default: FALSE
  3680. *
  3681. *            LATD_Tick (BOOL) - Hear IDCMP_GADGETUP events while the
  3682. *                buttons is being pressed; the IntuiMessage->Code entry
  3683. *                will be 0 while the button is being pressed, and
  3684. *                will be 1 as soon as the button is released. (V12)
  3685. *
  3686. *                Default: FALSE
  3687. *
  3688. *
  3689. *        TEXT_KIND:
  3690. *
  3691. *            LATX_Picker (BOOL) - Attach a `select' button to the
  3692. *                right hand side of the text display.
  3693. *                Default: FALSE
  3694. *
  3695. *            LATX_LockSize (BOOL) - After doing the initial layout
  3696. *                for this object, do not adapt its size again during
  3697. *                subsequent layouts. This is particularly useful if
  3698. *                you have a TEXT_KIND object in a paged group
  3699. *                and update its contents later. You need
  3700. *                to specify an object width using LA_Chars, otherwise
  3701. *                the layout engine may make it not wide enough to
  3702. *                display any text. (V15)
  3703. *
  3704. *        TEXTEDIT_KIND (multiline string gadget):
  3705. *
  3706. *            (requires gtlayout.library V46 or higher)
  3707. *
  3708. *            LATE_String (STRPTR) - Pointer to the string to be
  3709. *                edited.
  3710. *
  3711. *            LATE_CursorPosition (ULONG) - Index number of the
  3712. *                character the cursor should be positioned on.
  3713. *                For example, in the string "abcd", the index
  3714. *                number 0 would put the cursor on the "a" and
  3715. *                the number 3 would put it on the "d".
  3716. *
  3717. *            LATE_Chars (LONG) - Width of the text editing area
  3718. *                in characters.
  3719. *
  3720. *            LATE_Lines (LONG) - Height of the text editing area
  3721. *                in lines.
  3722. *
  3723. *            LATE_TextAttr (struct TextAttr *) - You can specify the
  3724. *                font to be used for the editing area.
  3725. *                The TextAttr (or TTextAttr) you provide must be ready
  3726. *                to go so the layout code can open the font later.
  3727. *
  3728. *                To get the current system default font, which is
  3729. *                guaranteed to be fixed-width, pass ~0 instead of a
  3730. *                pointer to a TextAttr structure.
  3731. *
  3732. *        VERTICAL_KIND (group to align objects vertically):
  3733. *        HORIZONTAL_KIND (group to align objects horizontally):
  3734. *
  3735. *            LAGR_Spread (BOOL) - Place all objects in this
  3736. *                group with roughly the same amount of space
  3737. *                between them.
  3738. *                Default: FALSE
  3739. *
  3740. *            LAGR_SameSize (BOOL) - Make all objects in this
  3741. *                group the same size (for vertical groups:
  3742. *                the same height, for horizontal groups:
  3743. *                the same width).
  3744. *                Default: FALSE
  3745. *
  3746. *            LAGR_LastAttributes (BOOL) - Try to copy the
  3747. *                size of the previous group for this new
  3748. *                group. May not work if this group turns
  3749. *                out to be larger than the previous group.
  3750. *                Default: FALSE
  3751. *
  3752. *            LAGR_ActivePage (LONG) - Organize all child
  3753. *                groups as pages which can be flipped through
  3754. *                using LT_SetAttributes(). You need to
  3755. *                specify the number of the first page to
  3756. *                display, starting from 0.
  3757. *
  3758. *                    NOTE: Specifying this tag actually enables
  3759. *                        the paging feature. If you omit this
  3760. *                        tag calls to flip to a specific
  3761. *                        page will fail.
  3762. *
  3763. *                Default: No paging
  3764. *
  3765. *            LAGR_Frame (BOOL) - Draw a recessed frame around
  3766. *                this group, even if there is no group label. (V7)
  3767. *
  3768. *            LAGR_IndentX (BOOL) - Add extra horizontal indentation
  3769. *                for this group. (V10)
  3770. *
  3771. *            LAGR_IndentY (BOOL) - Add extra vertical indentation
  3772. *                for this group. (V10)
  3773. *
  3774. *            LAGR_NoIndent (BOOL) - Inhibit automatic size adjustion
  3775. *                and centring of this group if it is smaller than
  3776. *                the neighbouring groups. (V21)
  3777. *
  3778. *            LAGR_SameWidth (WORD) - During the final layout pass,
  3779. *                make this group the same width as the group which
  3780. *                uses the given ID. Not implemented yet. (V25)
  3781. *
  3782. *            LAGR_SameHeight (WORD) - During the final layout pass,
  3783. *                make this group the same height as the group which
  3784. *                uses the given ID. Not implemented yet. (V25)
  3785. *
  3786. *            LAGR_FrameGroup (UWORD) - Surround this group with a
  3787. *                frame. Must be one of FRAMETYPE_Label or FRAMETYPE_Tab.
  3788. *                FRAMETYPE_Label works like "LAGR_Frame,TRUE," while
  3789. *                FRAMETYPE_Tab is for use with a TAB_KIND object you
  3790. *                must put directly on top of this group or the group
  3791. *                will look a little silly. (V38)
  3792. *
  3793. *                Default: FRAMETYPE_None
  3794. *
  3795. *
  3796. *        XBAR_KIND (horizontal separator bar):
  3797. *
  3798. *            LAXB_FullSize (BOOL) - Make this separator bar span
  3799. *                the entire window width.
  3800. *
  3801. *
  3802. *        YBAR_KIND (vertical separator bar):
  3803. *
  3804. *            No tags are defined for this type of object.
  3805. *
  3806. *
  3807. *   RESULT
  3808. *    none
  3809. *
  3810. *   BUGS
  3811. *    Up to v25 the SCROLLER_KIND object did not support GA_Immediate
  3812. *    or GA_RelVerify. The space for the variables was there, but the
  3813. *    code was missing.
  3814. *
  3815. *    POPUP_KIND objects don't work well in simple refresh windows,
  3816. *    as refresh events can get lost. Use a smart refresh window
  3817. *    instead or call gadtools.library/LT_CatchUpRefresh() regularly.
  3818. *
  3819. *   SEE ALSO
  3820. *    gadtools.library/CreateGadgetA
  3821. *
  3822. ******************************************************************************
  3823. *
  3824. */
  3825.  
  3826. VOID LIBENT
  3827. LT_NewA(REG(a0) LayoutHandle *handle,REG(a1) struct TagItem *tagList)
  3828. {
  3829.     if(handle != NULL)
  3830.     {
  3831.         struct TagItem *List,*Entry;
  3832.         STRPTR label;
  3833.         LONG type;
  3834.         LONG id;
  3835.  
  3836.         type    = -1;
  3837.         label    = NULL;
  3838.         id        = 0;
  3839.         List    = tagList;
  3840.  
  3841.         while((Entry = NextTagItem(&List)) != NULL)
  3842.         {
  3843.             switch(Entry->ti_Tag)
  3844.             {
  3845.                 case LA_Type:
  3846.  
  3847.                     type = Entry->ti_Data;
  3848.                     break;
  3849.  
  3850.                 case LA_ID:
  3851.  
  3852.                     id = Entry->ti_Data;
  3853.                     break;
  3854.  
  3855.                 case LA_LabelID:
  3856.  
  3857.                     if(handle->LocaleHook != NULL)
  3858.                     {
  3859.                         label = (STRPTR)CallHookPkt(handle->LocaleHook,handle,(APTR)Entry->ti_Data);
  3860.                     }
  3861.                     else
  3862.                     {
  3863.                         handle->Failed = TRUE;
  3864.  
  3865.                         return;
  3866.                     }
  3867.  
  3868.                     break;
  3869.  
  3870.                 case LA_LabelText:
  3871.  
  3872.                     label = (STRPTR)Entry->ti_Data;
  3873.                     break;
  3874.             }
  3875.         }
  3876.  
  3877.         LT_AddA(handle,type,label,id,tagList);
  3878.     }
  3879. }
  3880.  
  3881.  
  3882. /*****************************************************************************/
  3883.  
  3884.  
  3885. /****** gtlayout.library/LT_EndGroup ******************************************
  3886. *
  3887. *   NAME
  3888. *    LT_EndGroup -- end a group declaration.
  3889. *
  3890. *   SYNOPSIS
  3891. *    LT_EndGroup(Handle);
  3892. *                 A0
  3893. *
  3894. *    VOID LT_EndGroup(LayoutHandle *);
  3895. *
  3896. *   FUNCTION
  3897. *      This is just a short form of
  3898. *
  3899. *           LT_New(Handle,
  3900. *               LA_Type, END_KIND,
  3901. *           TAG_DONE);
  3902. *
  3903. *      It helps to save (some) space.
  3904. *
  3905. *   INPUTS
  3906. *        Handle - Pointer to LayoutHandle.
  3907. *
  3908. *   RESULT
  3909. *    none
  3910. *
  3911. *   SEE ALSO
  3912. *    gtlayout.library/LT_New
  3913. *
  3914. ******************************************************************************
  3915. *
  3916. */
  3917.  
  3918. VOID LIBENT
  3919. LT_EndGroup(REG(a0) LayoutHandle *handle)
  3920. {
  3921.     if(handle != NULL && NOT handle->Failed)
  3922.     {
  3923.         /* new in 45.1: fail if there is no group to be closed */
  3924.         if(handle->CurrentGroup == NULL)
  3925.         {
  3926.             handle->Failed = TRUE;
  3927.         }
  3928.         else
  3929.         {
  3930.             handle->CurrentGroup = handle->CurrentGroup->Special.Group.ParentGroup;
  3931.         }
  3932.     }
  3933. }
  3934.